docker.yml 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. name: Docker
  2. on:
  3. schedule:
  4. - cron: '0 1 * * *'
  5. push:
  6. tags:
  7. - '*.*.*'
  8. jobs:
  9. docker-images:
  10. runs-on: ubuntu-latest
  11. steps:
  12. - name: Checkout
  13. uses: actions/checkout@v2
  14. with:
  15. fetch-depth: 0
  16. - name: Generate Docker tag
  17. id: docker_tag
  18. run: |
  19. DOCKER_IMAGE=miniflux/miniflux
  20. DOCKER_VERSION=dev
  21. if [ "${{ github.event_name }}" = "schedule" ]; then
  22. DOCKER_VERSION=nightly
  23. TAGS="${DOCKER_IMAGE}:${DOCKER_VERSION},ghcr.io/${DOCKER_IMAGE}:${DOCKER_VERSION}"
  24. elif [[ $GITHUB_REF == refs/tags/* ]]; then
  25. DOCKER_VERSION=${GITHUB_REF#refs/tags/}
  26. TAGS="${DOCKER_IMAGE}:${DOCKER_VERSION},ghcr.io/${DOCKER_IMAGE}:${DOCKER_VERSION},${DOCKER_IMAGE}:latest,ghcr.io/${DOCKER_IMAGE}:latest"
  27. fi
  28. echo ::set-output name=tags::${TAGS}
  29. - name: Set up QEMU
  30. uses: docker/setup-qemu-action@v1
  31. - name: Set up Docker Buildx
  32. uses: docker/setup-buildx-action@v1
  33. - name: Login to DockerHub
  34. uses: docker/login-action@v1
  35. with:
  36. username: ${{ secrets.DOCKERHUB_USERNAME }}
  37. password: ${{ secrets.DOCKERHUB_TOKEN }}
  38. - name: Login to GitHub Container Registry
  39. uses: docker/login-action@v1
  40. with:
  41. registry: ghcr.io
  42. username: ${{ github.repository_owner }}
  43. password: ${{ secrets.CR_PAT }}
  44. - name: Build and push
  45. uses: docker/build-push-action@v2
  46. with:
  47. context: .
  48. file: ./packaging/docker/Dockerfile
  49. platforms: linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64
  50. push: true
  51. tags: ${{ steps.docker_tag.outputs.tags }}