@universium/deploy-aws-website
v0.0.5
Published
NodeJS script to set up AWS S3 and AWS CloudFront to host a static website
Downloads
4
Readme
Automatic static website deployment script
IMPORTANT: Requires NodeJS LTS:
npm install -g n && sudo n lts
It takes a static website content (with index.html
file), and set up the AWS infrastructure to host that website (incl. AWS S3, AWS CloudFront, custom domains, SSL certificate).
Usage
1. Install dev dependency:
npm i @universium/deploy-aws-website --save-dev
2. Create appropriate deploy.json
or deploy.env.json
files inside your poject root directory. See the example below:
{
"profile": "<aws config profile name>",
"region": "<aws region>",
"bucket": "<desired aws s3 bucket name>",
"wwwroot": "<relative or absolute path where index.html is located>",
"alias": "<custom domain name>"
}
3. Run the following script & follow the instructions:
node node_modules/@universium/deploy-aws-website/deploy.mjs [--envname]
4. Add the following script to your package.json
scripts
section:
{
"scripts": {
"deploy": "node node_modules/@universium/deploy-aws-website/deploy.mjs"
}
}
Or, to build Angular & Deploy
{
"scripts": {
"deploy": "ng build && node node_modules/@universium/deploy-aws-website/deploy.mjs"
}
}
- Run the following on code changes:
npm run deploy [-- --envname]
- Enjoy!