docker.yml 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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,suffix=-distroless
  43. type=schedule,pattern=nightly,suffix=-distroless
  44. type=semver,pattern={{raw}},suffix=-distroless
  45. - name: Set up QEMU
  46. uses: docker/setup-qemu-action@v3
  47. - name: Set up Docker Buildx
  48. uses: docker/setup-buildx-action@v3
  49. - name: Login to DockerHub
  50. if: github.event_name != 'pull_request'
  51. uses: docker/login-action@v3
  52. with:
  53. username: ${{ secrets.DOCKERHUB_USERNAME }}
  54. password: ${{ secrets.DOCKERHUB_TOKEN }}
  55. - name: Login to GitHub Container Registry
  56. if: github.event_name != 'pull_request'
  57. uses: docker/login-action@v3
  58. with:
  59. registry: ghcr.io
  60. username: ${{ github.repository_owner }}
  61. password: ${{ secrets.GITHUB_TOKEN }}
  62. - name: Login to Quay Container Registry
  63. if: github.event_name != 'pull_request'
  64. uses: docker/login-action@v3
  65. with:
  66. registry: quay.io
  67. username: ${{ secrets.QUAY_USERNAME }}
  68. password: ${{ secrets.QUAY_TOKEN }}
  69. - name: Build and Push Alpine images
  70. uses: docker/build-push-action@v5
  71. with:
  72. context: .
  73. file: ./packaging/docker/alpine/Dockerfile
  74. platforms: linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64
  75. push: ${{ github.event_name != 'pull_request' }}
  76. tags: ${{ steps.docker_alpine_tags.outputs.tags }}
  77. - name: Build and Push Distroless images
  78. uses: docker/build-push-action@v5
  79. with:
  80. context: .
  81. file: ./packaging/docker/distroless/Dockerfile
  82. platforms: linux/amd64,linux/arm64
  83. push: ${{ github.event_name != 'pull_request' }}
  84. tags: ${{ steps.docker_distroless_tags.outputs.tags }}