docker.yml 1.7 KB

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