From fee5ad917fa6a9f073fead6225a9c9a7bcf2e8d0 Mon Sep 17 00:00:00 2001 From: kiloreux Date: Mon, 10 Jan 2022 11:03:49 +0100 Subject: [PATCH] Fix Companion deploys (#3388) * Change compilation to postinstall * Deploy * Restore shape * Reduce builds * Use docker instead * Use port as second variable * Change * Minor fixes * Update .github/workflows/companion-deploy.yml Co-authored-by: Mikael Finstad Co-authored-by: Mikael Finstad --- .github/workflows/companion-deploy.yml | 6 +++++- packages/@uppy/companion/Procfile | 1 - packages/@uppy/companion/heroku.yml | 3 +++ packages/@uppy/companion/src/standalone/start-server.js | 2 +- 4 files changed, 9 insertions(+), 3 deletions(-) delete mode 100644 packages/@uppy/companion/Procfile create mode 100644 packages/@uppy/companion/heroku.yml diff --git a/.github/workflows/companion-deploy.yml b/.github/workflows/companion-deploy.yml index 9d08465c3..d55a98d1b 100644 --- a/.github/workflows/companion-deploy.yml +++ b/.github/workflows/companion-deploy.yml @@ -1,5 +1,6 @@ name: Companion Deploy + on: push: branches: [main] @@ -43,10 +44,13 @@ jobs: steps: - name: Checkout sources uses: actions/checkout@v2 + - name: Alter dockerfile + run: | + sed -i 's/^EXPOSE 3020$/EXPOSE $PORT/g' Dockerfile - name: Deploy to heroku uses: akhileshns/heroku-deploy@v3.12.12 with: - appdir: packages/@uppy/companion heroku_api_key: ${{secrets.HEROKU_API_KEY}} heroku_app_name: companion-demo heroku_email: ${{secrets.HEROKU_EMAIL}} + usedocker: true diff --git a/packages/@uppy/companion/Procfile b/packages/@uppy/companion/Procfile deleted file mode 100644 index 7af495ec6..000000000 --- a/packages/@uppy/companion/Procfile +++ /dev/null @@ -1 +0,0 @@ -web: COMPANION_PORT=$PORT node ./src/standalone/start-server diff --git a/packages/@uppy/companion/heroku.yml b/packages/@uppy/companion/heroku.yml new file mode 100644 index 000000000..8eec25b9c --- /dev/null +++ b/packages/@uppy/companion/heroku.yml @@ -0,0 +1,3 @@ +build: + docker: + web: Dockerfile diff --git a/packages/@uppy/companion/src/standalone/start-server.js b/packages/@uppy/companion/src/standalone/start-server.js index ec0a366e0..7b03f517e 100755 --- a/packages/@uppy/companion/src/standalone/start-server.js +++ b/packages/@uppy/companion/src/standalone/start-server.js @@ -4,7 +4,7 @@ const companion = require('../companion') const { version } = require('../../package.json') const standalone = require('.') -const port = process.env.COMPANION_PORT || 3020 +const port = process.env.COMPANION_PORT || process.env.PORT || 3020 const { app } = standalone()