release.yml 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. name: Release
  2. on:
  3. release:
  4. types: [created]
  5. env:
  6. REGISTRY: ghcr.io
  7. IMAGE_NAME: ${{ github.repository }}
  8. jobs:
  9. build:
  10. runs-on: ubuntu-latest
  11. permissions:
  12. contents: read
  13. packages: write
  14. steps:
  15. - uses: actions/checkout@v4
  16. - uses: docker/setup-qemu-action@v3
  17. - uses: docker/setup-buildx-action@v3
  18. - uses: docker/login-action@v3
  19. with:
  20. registry: ${{ env.REGISTRY }}
  21. username: ${{ github.actor }}
  22. password: ${{ secrets.GITHUB_TOKEN }}
  23. - uses: docker/metadata-action@v5
  24. id: meta
  25. with:
  26. images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
  27. tags: |
  28. type=ref,event=branch
  29. type=ref,event=pr
  30. type=semver,pattern={{version}}
  31. - uses: docker/build-push-action@v5
  32. with:
  33. context: .
  34. platforms: linux/amd64,linux/arm64
  35. push: true
  36. tags: ${{ steps.meta.outputs.tags }}
  37. labels: ${{ steps.meta.outputs.labels }}
  38. build-args: |
  39. VERSION=${{ steps.meta.outputs.version }}