companion-deploy.yml 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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-buildx-action@v1
  26. - name: Log in to DockerHub
  27. uses: docker/login-action@v1
  28. with:
  29. username: ${{secrets.DOCKER_USERNAME}}
  30. password: ${{secrets.DOCKER_PASSWORD}}
  31. - name: Build and push
  32. uses: docker/build-push-action@v2
  33. with:
  34. push: true
  35. context: .
  36. file: Dockerfile
  37. tags: ${{ steps.docker_meta.outputs.tags }}
  38. labels: ${{ steps.docker_meta.outputs.labels }}
  39. heroku:
  40. name: Heroku
  41. runs-on: ubuntu-latest
  42. steps:
  43. - name: Checkout sources
  44. uses: actions/checkout@v3
  45. - name: Alter dockerfile
  46. run: |
  47. sed -i 's/^EXPOSE 3020$/EXPOSE $PORT/g' Dockerfile
  48. - name: Deploy to heroku
  49. uses: akhileshns/heroku-deploy@v3.12.12
  50. with:
  51. heroku_api_key: ${{secrets.HEROKU_API_KEY}}
  52. heroku_app_name: companion-demo
  53. heroku_email: ${{secrets.HEROKU_EMAIL}}
  54. usedocker: true