docker.yml 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. name: Docker
  2. on:
  3. schedule:
  4. - cron: '0 1 * * *'
  5. push:
  6. tags:
  7. - '[0-9]+.[0-9]+.[0-9]+'
  8. pull_request:
  9. branches: [ main ]
  10. paths:
  11. - 'packaging/docker/**'
  12. jobs:
  13. docker-images:
  14. name: Docker Images
  15. permissions:
  16. packages: write
  17. runs-on: ubuntu-latest
  18. steps:
  19. - name: Checkout
  20. uses: actions/checkout@v6
  21. with:
  22. fetch-depth: 0
  23. - name: Generate Alpine Docker tags
  24. id: docker_alpine_tags
  25. uses: docker/metadata-action@v5
  26. with:
  27. images: |
  28. docker.io/${{ github.repository_owner }}/miniflux
  29. ghcr.io/${{ github.repository_owner }}/miniflux
  30. quay.io/${{ github.repository_owner }}/miniflux
  31. tags: |
  32. type=ref,event=pr
  33. type=schedule,pattern=nightly
  34. type=semver,pattern={{raw}}
  35. - name: Generate Distroless Docker tags
  36. id: docker_distroless_tags
  37. uses: docker/metadata-action@v5
  38. with:
  39. images: |
  40. docker.io/${{ github.repository_owner }}/miniflux
  41. ghcr.io/${{ github.repository_owner }}/miniflux
  42. quay.io/${{ github.repository_owner }}/miniflux
  43. tags: |
  44. type=ref,event=pr
  45. type=schedule,pattern=nightly
  46. type=semver,pattern={{raw}}
  47. flavor: |
  48. suffix=-distroless,onlatest=true
  49. - name: Set up QEMU
  50. uses: docker/setup-qemu-action@v3
  51. - name: Set up Docker Buildx
  52. uses: docker/setup-buildx-action@v3
  53. - name: Login to DockerHub
  54. if: ${{ github.event_name != 'pull_request' && vars.PUBLISH_DOCKER_IMAGES == 'true' }}
  55. uses: docker/login-action@v3
  56. with:
  57. username: ${{ secrets.DOCKERHUB_USERNAME }}
  58. password: ${{ secrets.DOCKERHUB_TOKEN }}
  59. - name: Login to GitHub Container Registry
  60. if: ${{ github.event_name != 'pull_request' && vars.PUBLISH_DOCKER_IMAGES == 'true' }}
  61. uses: docker/login-action@v3
  62. with:
  63. registry: ghcr.io
  64. username: ${{ github.repository_owner }}
  65. password: ${{ secrets.GITHUB_TOKEN }}
  66. - name: Login to Quay Container Registry
  67. if: ${{ github.event_name != 'pull_request' && vars.PUBLISH_DOCKER_IMAGES == 'true' }}
  68. uses: docker/login-action@v3
  69. with:
  70. registry: quay.io
  71. username: ${{ secrets.QUAY_USERNAME }}
  72. password: ${{ secrets.QUAY_TOKEN }}
  73. - name: Build and Push Alpine images
  74. uses: docker/build-push-action@v6
  75. if: ${{ vars.PUBLISH_DOCKER_IMAGES == 'true' }}
  76. with:
  77. context: .
  78. file: ./packaging/docker/alpine/Dockerfile
  79. platforms: linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64
  80. push: ${{ github.event_name != 'pull_request' }}
  81. tags: ${{ steps.docker_alpine_tags.outputs.tags }}
  82. - name: Build and Push Distroless images
  83. uses: docker/build-push-action@v6
  84. if: ${{ vars.PUBLISH_DOCKER_IMAGES == 'true' }}
  85. with:
  86. context: .
  87. file: ./packaging/docker/distroless/Dockerfile
  88. platforms: linux/amd64,linux/arm64
  89. push: ${{ github.event_name != 'pull_request' }}
  90. tags: ${{ steps.docker_distroless_tags.outputs.tags }}