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.

68 lines
1.9 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. platforms: linux/amd64,linux/arm64
  38. file: ./docker/Dockerfile
  39. push: ${{ github.event_name != 'pull_request' }}
  40. tags: ${{ steps.docker_meta.outputs.tags }}
  41. labels: ${{ steps.docker_meta.outputs.labels }}
  42. - name: Build a backend image and push
  43. uses: docker/build-push-action@v3
  44. with:
  45. context: .
  46. platforms: linux/amd64,linux/arm64
  47. file: ./docker/Dockerfile.prod
  48. push: ${{ github.event_name != 'pull_request' }}
  49. tags: doccano/doccano:backend
  50. labels: ${{ steps.docker_meta.outputs.labels }}
  51. - name: Build a frontend image and push
  52. uses: docker/build-push-action@v3
  53. with:
  54. context: .
  55. platforms: linux/amd64,linux/arm64
  56. file: ./docker/Dockerfile.nginx
  57. push: ${{ github.event_name != 'pull_request' }}
  58. tags: doccano/doccano:frontend
  59. labels: ${{ steps.docker_meta.outputs.labels }}