Skip to content
This repository has been archived by the owner on Feb 13, 2021. It is now read-only.

Commit

Permalink
Support deployments to staging and production
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbainter committed Mar 19, 2019
1 parent e5fd636 commit ef1ce37
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 4 additions & 1 deletion node_scripts/deploy.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ const { gzip } = require('node-gzip');
const { lookup } = require('mime-types');
const envs = require('./secrets');

const { bucketName, cloudfrontDistributionId } = envs.staging;
const { bucketName, cloudfrontDistributionId } =
process.argv.length >= 3 && process.argv[2] === '-p'
? envs.production
: envs.staging;

const DIST_DIR = 'dist';
const S3_API_VERSION = '2006-03-01';
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
"test": "echo \"Error: no test specified\" && exit 1",
"start": "webpack-dev-server",
"build": "cross-env NODE_ENV=production webpack-cli --mode production --config webpack.prod.config.js",
"deploy": "npm run lint && npm run build && node node_scripts/deploy.js",
"predeploy": "npm run lint && npm run build",
"deploy:staging": "npm run predeploy && node node_scripts/deploy.js",
"deploy:production": "npm run predeploy && node node_scripts/deploy.js -p",
"lint": "eslint .",
"postversion": "git push && git push --tags"
},
Expand Down

0 comments on commit ef1ce37

Please sign in to comment.