docker.yml 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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. - name: Generate Docker tag
  15. id: docker_tag
  16. run: |
  17. DOCKER_IMAGE=miniflux/miniflux
  18. DOCKER_VERSION=dev
  19. if [ "${{ github.event_name }}" = "schedule" ]; then
  20. DOCKER_VERSION=nightly
  21. elif [[ $GITHUB_REF == refs/tags/* ]]; then
  22. DOCKER_VERSION=${GITHUB_REF#refs/tags/}
  23. fi
  24. TAGS="${DOCKER_IMAGE}:${DOCKER_VERSION}"
  25. echo ::set-output name=version::${DOCKER_VERSION}
  26. echo ::set-output name=tags::${TAGS}
  27. echo ::set-output name=created::$(date -u +'%Y-%m-%dT%H:%M:%SZ')
  28. - name: Set up QEMU
  29. uses: docker/setup-qemu-action@v1
  30. - name: Set up Docker Buildx
  31. uses: docker/setup-buildx-action@v1
  32. - name: Login to DockerHub
  33. uses: docker/login-action@v1
  34. with:
  35. username: ${{ secrets.DOCKERHUB_USERNAME }}
  36. password: ${{ secrets.DOCKERHUB_TOKEN }}
  37. - name: Build and push
  38. uses: docker/build-push-action@v2
  39. with:
  40. context: .
  41. file: ./packaging/docker/Dockerfile
  42. platforms: linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64
  43. push: true
  44. tags: ${{ steps.docker_tag.outputs.tags }}