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