docker.yml 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. name: Docker
  2. on:
  3. schedule:
  4. - cron: '0 1 * * *'
  5. push:
  6. tags:
  7. - '*.*.*'
  8. jobs:
  9. multi:
  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. elif [[ $GITHUB_REF == refs/tags/* ]]; then
  24. DOCKER_VERSION=${GITHUB_REF#refs/tags/}
  25. fi
  26. TAGS="${DOCKER_IMAGE}:${DOCKER_VERSION}"
  27. echo ::set-output name=version::${DOCKER_VERSION}
  28. echo ::set-output name=tags::${TAGS}
  29. echo ::set-output name=created::$(date -u +'%Y-%m-%dT%H:%M:%SZ')
  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: Build and push
  40. uses: docker/build-push-action@v2
  41. with:
  42. context: .
  43. file: ./packaging/docker/Dockerfile
  44. platforms: linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64
  45. push: true
  46. tags: ${{ steps.docker_tag.outputs.tags }}