dockerhub.yml 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  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. context: .
  53. file: Dockerfile
  54. platforms: linux/amd64,linux/arm64,linux/arm/v7
  55. push: true
  56. tags: ${{ steps.docker_meta_debian.outputs.tags }}
  57. labels: ${{ steps.docker_meta_debian.outputs.labels }}
  58. - name: Images digests
  59. run: echo ${{ steps.docker_build_debian.outputs.digest }}
  60. multiarch-build-alpine:
  61. runs-on: ubuntu-latest
  62. steps:
  63. - name: Checkout
  64. uses: actions/checkout@v2
  65. with:
  66. fetch-depth: 0
  67. - name: Get Docker tags for Alpine based image
  68. id: docker_meta_alpine
  69. uses: crazy-max/ghaction-docker-meta@v2
  70. with:
  71. images: |
  72. nginxproxy/nginx-proxy
  73. jwilder/nginx-proxy
  74. tags: |
  75. type=semver,suffix=-alpine,pattern={{version}}
  76. type=semver,suffix=-alpine,pattern={{major}}.{{minor}}
  77. type=raw,value=alpine,enable=${{ endsWith(github.ref, github.event.repository.default_branch) }}
  78. flavor: latest=false
  79. - name: Set up QEMU
  80. uses: docker/setup-qemu-action@v1
  81. - name: Set up Docker Buildx
  82. uses: docker/setup-buildx-action@v1
  83. - name: Login to DockerHub
  84. uses: docker/login-action@v1
  85. with:
  86. username: ${{ secrets.DOCKERHUB_USERNAME }}
  87. password: ${{ secrets.DOCKERHUB_TOKEN }}
  88. - name: Build and push the Alpine based image
  89. id: docker_build_alpine
  90. uses: docker/build-push-action@v2
  91. with:
  92. context: .
  93. file: Dockerfile.alpine
  94. platforms: linux/amd64,linux/arm64,linux/arm/v7
  95. push: true
  96. tags: ${{ steps.docker_meta_alpine.outputs.tags }}
  97. labels: ${{ steps.docker_meta_alpine.outputs.labels }}
  98. - name: Images digests
  99. run: echo ${{ steps.docker_build_alpine.outputs.digest }}