docker-ci.yml 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. name: docker-ci
  2. on:
  3. push:
  4. tags:
  5. - 'v*.*.*'
  6. jobs:
  7. docker:
  8. runs-on: ubuntu-latest
  9. steps:
  10. -
  11. name: Checkout
  12. uses: actions/checkout@v4
  13. with:
  14. fetch-depth: 0
  15. -
  16. name: Find Git Tag
  17. id: tagger
  18. uses: jimschubert/query-tag-action@v2
  19. with:
  20. include: 'v*'
  21. exclude: '*-rc*'
  22. commit-ish: 'HEAD'
  23. skip-unshallow: 'true'
  24. abbrev: 7
  25. - name: Docker meta
  26. id: meta
  27. uses: docker/metadata-action@v5
  28. with:
  29. # list of Docker images to use as base name for tags
  30. images: |
  31. ${{ secrets.DOCKERHUB_USERNAME }}/${{ github.event.repository.name }}
  32. # generate Docker tags based on the following events/attributes
  33. tags: |
  34. type=semver,pattern={{version}}
  35. type=semver,pattern={{major}}.{{minor}}
  36. type=semver,pattern={{major}}
  37. type=sha
  38. -
  39. name: Set up QEMU
  40. uses: docker/setup-qemu-action@v3
  41. -
  42. name: Set up Docker Buildx
  43. uses: docker/setup-buildx-action@v3
  44. -
  45. name: Login to DockerHub
  46. uses: docker/login-action@v3
  47. with:
  48. username: ${{ secrets.DOCKERHUB_USERNAME }}
  49. password: ${{ secrets.DOCKERHUB_TOKEN }}
  50. -
  51. name: Build and push
  52. id: docker_build
  53. uses: docker/build-push-action@v5
  54. with:
  55. context: .
  56. platforms: linux/amd64,linux/arm64,linux/386,linux/arm/v7
  57. push: true
  58. tags: ${{ steps.meta.outputs.tags }}
  59. labels: ${{ steps.meta.outputs.labels }}
  60. build-args: 'GIT_DESC=${{steps.tagger.outputs.tag}}'