release.yml 971 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. name: Docker Image CI
  2. on:
  3. push:
  4. tags:
  5. - "*"
  6. env:
  7. REGISTRY: ghcr.io
  8. jobs:
  9. build-and-push-image:
  10. runs-on: ubuntu-latest
  11. permissions:
  12. contents: read
  13. packages: write
  14. steps:
  15. - name: Get version
  16. id: get_version
  17. run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
  18. - uses: actions/checkout@v3
  19. - name: Log in to the Container registry
  20. uses: docker/login-action@v2.1.0
  21. with:
  22. registry: ${{ env.REGISTRY }}
  23. username: ${{ github.actor }}
  24. password: ${{ secrets.GITHUB_TOKEN }}
  25. - name: Build and push Docker images
  26. uses: docker/build-push-action@v4
  27. with:
  28. context: .
  29. push: true
  30. tags: |
  31. ${{ env.REGISTRY }}/${{ github.actor,, }}/${{ github.repository,, }}:${{ steps.get_version.outputs.VERSION }}
  32. ${{ env.REGISTRY }}/${{ github.actor,, }}/${{ github.repository,, }}:latest