docker.yml 3.2 KB

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