container-image.yml 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. ---
  2. name: container image
  3. on:
  4. push:
  5. pull_request:
  6. schedule:
  7. - cron: '0 20 * * 5'
  8. jobs:
  9. docker-build:
  10. runs-on: ubuntu-22.04
  11. permissions: {packages: write}
  12. steps:
  13. - uses: docker/setup-qemu-action@v3.2.0
  14. - uses: docker/login-action@v3
  15. with:
  16. registry: ghcr.io
  17. username: ${{ github.actor }}
  18. password: ${{ secrets.GITHUB_TOKEN }}
  19. - uses: docker/setup-buildx-action@v3.8.0
  20. # > By default, this action uses the Git context so you don't need to use
  21. # > the actions/checkout action to checkout the repository because this
  22. # > will be done directly by buildkit. [...]
  23. # > any file mutation in the steps that precede [...] will be ignored,
  24. # > including processing of the .dockerignore file
  25. # https://github.com/marketplace/actions/build-and-push-docker-images
  26. # > The commit history is not preserved.
  27. # https://docs.docker.com/engine/reference/commandline/build/#git-repositories
  28. - uses: docker/build-push-action@v6.10.0
  29. with:
  30. build-args: | # git history unavailable (see above)
  31. SETUPTOOLS_SCM_PRETEND_VERSION=0
  32. platforms: |
  33. linux/amd64
  34. linux/arm/v6
  35. linux/arm/v7
  36. linux/arm64
  37. push: true
  38. tags: |
  39. ghcr.io/${{ github.actor }}/systemctl-mqtt:${{ github.sha }}-attempt${{ github.run_attempt }}