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.

65 lines
1.8 KiB

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