Skip to content

Commit

Permalink
Set env var for deploy in Github Action workflow (#188)
Browse files Browse the repository at this point in the history
* Reorder imports

* Build both spotlight and doj-demo on main and stable

* Remove "deploy" call from Dockerfile.
Context: I don't recall why this is here, but we'll find out soon

* Add "pnpm deploy" step

* Add separate workspaces for main and staging, and separate scripts for main and staging environments.

* Fix type error on story

* Use environment variables to distinguish separate deployment environments.

* Set env var for deploy in Github Action workflow
  • Loading branch information
danielnaab authored Jun 14, 2024
1 parent 9cca8fd commit 4418402
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,4 +99,4 @@ jobs:
run: |
cd infra
cf api https://api.fr.cloud.gov
pnpm cdktf deploy --auto-approve
DEPLOY_ENV=${TAG_NAME} pnpm cdktf deploy --auto-approve
4 changes: 2 additions & 2 deletions infra/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
"build": "pnpm build:tsc && pnpm build:synth",
"build:get": "cdktf get",
"build:synth": "pnpm build:synth:main && pnpm build:synth:staging",
"build:synth:main": "DEPLOY_ENV=dev cdktf synth",
"build:synth:main": "DEPLOY_ENV=main cdktf synth",
"build:synth:staging": "DEPLOY_ENV=staging cdktf synth",
"build:tsc": "tsc --pretty",
"clean": "rm -rf .gen cdktf.out",
"deploy:main": "DEPLOY_ENV=dev cdktf deploy",
"deploy:main": "DEPLOY_ENV=main cdktf deploy",
"deploy:staging": "DEPLOY_ENV=staging cdktf deploy",
"dev": "tsc -w",
"test": "jest",
Expand Down
2 changes: 1 addition & 1 deletion infra/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const app = new App();
const deployEnv = process.env.DEPLOY_ENV;

switch (deployEnv) {
case 'dev':
case 'main':
import('./spaces/main');
break;
case 'staging':
Expand Down

0 comments on commit 4418402

Please sign in to comment.