companion-deploy.yml 1.6 KB

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