Skip to content

Commit

Permalink
Chore: Support heroku review apps (ToolJet#1560)
Browse files Browse the repository at this point in the history
* add heroku predeploy script

* test env injected

* test prebuild heroku

* fix filename

* cancel inprogress pipeline

* change file permission

* test env replaced

* server install on predeploy

* frontend build on predeploy

* run as postdeploy script
  • Loading branch information
akshaysasidrn authored Dec 13, 2021
1 parent 511ec55 commit f76b675
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

concurrency:
group: ${{ github.head_ref }}
cancel-in-progress: true

env:
FORCE_COLOR: true
NODE_OPTIONS: "--max-old-space-size=4096"
Expand Down
9 changes: 9 additions & 0 deletions heroku-postdeploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/sh

if [ $HEROKU_APP_NAME ]
then
TOOLJET_HOST="https://${HEROKU_APP_NAME}.herokuapp.com"
TOOLJET_SERVER_URL="https://${HEROKU_APP_NAME}.herokuapp.com"
fi

npm run build && npm run deploy
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@
"db:reset": "npm --prefix server run db:reset",
"db:drop": "npm --prefix server run db:drop",
"deploy": "cp -a frontend/build/. public/",
"heroku-postbuild": "npm run build && npm run deploy",
"heroku-prebuild": "npm --prefix frontend install && npm --prefix server install ",
"heroku-postbuild": "./heroku-postdeploy.sh",
"heroku-prebuild": "npm --prefix frontend install && npm --prefix server install",
"cy:run": "cypress run --env db.name=$TEST_PG_DB,db.user=$TEST_PG_USERNAME,db.password=$TEST_PG_PASSWORD",
"cy:open": "cypress open --env db.name=$TEST_PG_DB,db.user=$TEST_PG_USERNAME,db.password=$TEST_PG_PASSWORD",
"prepare": "husky install"
Expand Down

0 comments on commit f76b675

Please sign in to comment.