You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

51 lines
1.2 KiB

  1. name: ci
  2. on:
  3. schedule:
  4. - cron: '0 10 * * *' # everyday at 10am
  5. push:
  6. branches:
  7. - master
  8. tags:
  9. - 'v*.*.*'
  10. jobs:
  11. docker:
  12. runs-on: ubuntu-latest
  13. steps:
  14. -
  15. name: Checkout
  16. uses: actions/checkout@v2
  17. -
  18. name: Docker meta
  19. id: docker_meta
  20. uses: crazy-max/ghaction-docker-meta@v1
  21. with:
  22. images: doccano/doccano
  23. tag-sha: true
  24. tag-semver: |
  25. {{version}}
  26. {{major}}.{{minor}}
  27. -
  28. name: Set up QEMU
  29. uses: docker/setup-qemu-action@v1
  30. -
  31. name: Set up Docker Buildx
  32. uses: docker/setup-buildx-action@v1
  33. -
  34. name: Login to DockerHub
  35. if: github.event_name != 'pull_request'
  36. uses: docker/login-action@v1
  37. with:
  38. username: ${{ secrets.DOCKERHUB_USERNAME }}
  39. password: ${{ secrets.DOCKERHUB_TOKEN }}
  40. -
  41. name: Build and push
  42. id: docker_build
  43. uses: docker/build-push-action@v2
  44. with:
  45. context: .
  46. file: ./Dockerfile
  47. push: ${{ github.event_name != 'pull_request' }}
  48. tags: ${{ steps.docker_meta.outputs.tags }}
  49. labels: ${{ steps.docker_meta.outputs.labels }}