You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

docker-image.yml 1.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. name: 'ghcr'
  2. on:
  3. push:
  4. branches:
  5. - "master"
  6. - "stable"
  7. tags:
  8. - 'v*'
  9. env:
  10. REGISTRY: ghcr.io
  11. IMAGE_NAME: ${{ github.repository }}
  12. jobs:
  13. build:
  14. name: Build
  15. runs-on: ubuntu-latest
  16. steps:
  17. - name: Checkout Git repository
  18. uses: actions/checkout@v3
  19. - name: Authenticate to container registry
  20. uses: docker/login-action@v2
  21. if: github.event_name != 'pull_request'
  22. with:
  23. registry: ${{ env.REGISTRY }}
  24. username: ${{ github.repository_owner }}
  25. password: ${{ secrets.GITHUB_TOKEN }}
  26. - name: Extract metadata
  27. id: meta
  28. uses: docker/metadata-action@v4
  29. with:
  30. images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
  31. - name: Setup Docker buildx driver
  32. id: buildx
  33. uses: docker/setup-buildx-action@v2
  34. - name: Build and publish image
  35. uses: docker/build-push-action@v3
  36. with:
  37. context: .
  38. push: ${{ github.event_name != 'pull_request' }}
  39. platforms: linux/amd64,linux/arm64
  40. tags: ${{ steps.meta.outputs.tags }}
  41. labels: ${{ steps.meta.outputs.labels }}