4
0

docker.yml 3.3 KB

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