companion-deploy.yml 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. name: Companion Deploy
  2. on:
  3. push:
  4. branches: [main]
  5. paths:
  6. - 'packages/@uppy/companion/**'
  7. jobs:
  8. docker:
  9. name: DockerHub
  10. runs-on: ubuntu-latest
  11. env:
  12. DOCKER_BUILDKIT: 0
  13. COMPOSE_DOCKER_CLI_BUILD: 0
  14. steps:
  15. - name: Checkout sources
  16. uses: actions/checkout@v3
  17. - name: Docker meta
  18. id: docker_meta
  19. uses: crazy-max/ghaction-docker-meta@v1
  20. with:
  21. images: transloadit/companion
  22. tag-sha: true
  23. tag-match: |
  24. \d{1,3}.\d{1,3}.\d{1,3}
  25. - uses: docker/setup-qemu-action@v2
  26. - uses: docker/setup-buildx-action@v2
  27. - name: Log in to DockerHub
  28. uses: docker/login-action@v2
  29. with:
  30. username: ${{secrets.DOCKER_USERNAME}}
  31. password: ${{secrets.DOCKER_PASSWORD}}
  32. - name: Build and push
  33. uses: docker/build-push-action@v3
  34. with:
  35. push: true
  36. context: .
  37. platforms: linux/amd64,linux/arm64
  38. file: Dockerfile
  39. tags: ${{ steps.docker_meta.outputs.tags }}
  40. labels: ${{ steps.docker_meta.outputs.labels }}
  41. heroku:
  42. name: Heroku
  43. runs-on: ubuntu-latest
  44. steps:
  45. - name: Checkout sources
  46. uses: actions/checkout@v3
  47. - name: Alter dockerfile
  48. run: |
  49. sed -i 's/^EXPOSE 3020$/EXPOSE $PORT/g' Dockerfile
  50. - name: Deploy to heroku
  51. uses: akhileshns/heroku-deploy@v3.12.12
  52. with:
  53. heroku_api_key: ${{secrets.HEROKU_API_KEY}}
  54. heroku_app_name: companion-demo
  55. heroku_email: ${{secrets.HEROKU_EMAIL}}
  56. usedocker: true