dockerhub.yml 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. name: DockerHub
  2. on:
  3. workflow_dispatch:
  4. schedule:
  5. - cron: '0 0 * * 1'
  6. push:
  7. branches:
  8. - main
  9. tags:
  10. - '*.*.*'
  11. paths-ignore:
  12. - 'test/*'
  13. - '.gitignore'
  14. - '.travis.yml'
  15. - 'docker-compose-separate-containers.yml'
  16. - 'docker-compose.yml'
  17. - 'LICENSE'
  18. - 'Makefile'
  19. - '*.md'
  20. jobs:
  21. multiarch-build-debian:
  22. runs-on: ubuntu-latest
  23. steps:
  24. - name: Checkout
  25. uses: actions/checkout@v2
  26. with:
  27. fetch-depth: 0
  28. - name: Get Docker tags for Debian based image
  29. id: docker_meta_debian
  30. uses: crazy-max/ghaction-docker-meta@v2
  31. with:
  32. images: |
  33. nginxproxy/nginx-proxy
  34. jwilder/nginx-proxy
  35. tags: |
  36. type=semver,pattern={{version}}
  37. type=semver,pattern={{major}}.{{minor}}
  38. type=raw,value=latest,enable=${{ endsWith(github.ref, github.event.repository.default_branch) }}
  39. - name: Set up QEMU
  40. uses: docker/setup-qemu-action@v1
  41. - name: Set up Docker Buildx
  42. uses: docker/setup-buildx-action@v1
  43. - name: Login to DockerHub
  44. uses: docker/login-action@v1
  45. with:
  46. username: ${{ secrets.DOCKERHUB_USERNAME }}
  47. password: ${{ secrets.DOCKERHUB_TOKEN }}
  48. - name: Build and push the Debian based image
  49. id: docker_build_debian
  50. uses: docker/build-push-action@v2
  51. with:
  52. file: Dockerfile
  53. platforms: linux/amd64,linux/arm64,linux/arm/v7
  54. push: true
  55. tags: ${{ steps.docker_meta_debian.outputs.tags }}
  56. labels: ${{ steps.docker_meta_debian.outputs.labels }}
  57. - name: Images digests
  58. run: echo ${{ steps.docker_build_debian.outputs.digest }}
  59. multiarch-build-alpine:
  60. runs-on: ubuntu-latest
  61. steps:
  62. - name: Checkout
  63. uses: actions/checkout@v2
  64. with:
  65. fetch-depth: 0
  66. - name: Get Docker tags for Alpine based image
  67. id: docker_meta_alpine
  68. uses: crazy-max/ghaction-docker-meta@v2
  69. with:
  70. images: |
  71. nginxproxy/nginx-proxy
  72. jwilder/nginx-proxy
  73. tags: |
  74. type=semver,suffix=-alpine,pattern={{version}}
  75. type=semver,suffix=-alpine,pattern={{major}}.{{minor}}
  76. type=raw,value=alpine,enable=${{ endsWith(github.ref, github.event.repository.default_branch) }}
  77. flavor: latest=false
  78. - name: Set up QEMU
  79. uses: docker/setup-qemu-action@v1
  80. - name: Set up Docker Buildx
  81. uses: docker/setup-buildx-action@v1
  82. - name: Login to DockerHub
  83. uses: docker/login-action@v1
  84. with:
  85. username: ${{ secrets.DOCKERHUB_USERNAME }}
  86. password: ${{ secrets.DOCKERHUB_TOKEN }}
  87. - name: Build and push the Alpine based image
  88. id: docker_build_alpine
  89. uses: docker/build-push-action@v2
  90. with:
  91. file: Dockerfile.alpine
  92. platforms: linux/amd64,linux/arm64,linux/arm/v7
  93. push: true
  94. tags: ${{ steps.docker_meta_alpine.outputs.tags }}
  95. labels: ${{ steps.docker_meta_alpine.outputs.labels }}
  96. - name: Images digests
  97. run: echo ${{ steps.docker_build_alpine.outputs.digest }}