Skip to content

Commit

Permalink
fix: add environments to deploy script
Browse files Browse the repository at this point in the history
  • Loading branch information
wessberg committed Oct 22, 2020
1 parent 25027db commit 488145b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
- name: Build
run: NODE_ENV=production npm run build

- name: Deploy (master)
- name: Deploy
run: node deploy.js
env:
PRODUCTION: ${{ github.ref == 'refs/heads/master' }}
Expand Down
6 changes: 4 additions & 2 deletions deploy.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
INTERNAL_PORT_DEVELOPMENT,
INTERNAL_PORT_PRODUCTION,
EXTERNAL_PORT_DEVELOPMENT,
EXTERNAL_PORT_PRODUCTION
EXTERNAL_PORT_PRODUCTION,
GITHUB_REF
} = process.env;

console.log("is production:", PRODUCTION);
Expand All @@ -34,7 +35,8 @@
INTERNAL_PORT_DEVELOPMENT,
INTERNAL_PORT_PRODUCTION,
EXTERNAL_PORT_DEVELOPMENT,
EXTERNAL_PORT_PRODUCTION
EXTERNAL_PORT_PRODUCTION,
GITHUB_REF
});
if (2 + 2 === 4) return;

Expand Down

0 comments on commit 488145b

Please sign in to comment.