This package makes it easy to deploy static web applications. It does this by exposing a small set of easy-to-use CLI commands and arguments to quickly deploy your entire project.
Currently it supports the following cloud deployment service:
- AWS S3 Static Website Hosting
- Netlify
This package requires Node >= 8.0**
.
You can install Node.js via the package provided on their site. Installing node will also install the Node Package Manager (NPM) to download and install node modules.
Installing Build Tools as a global module will give you command-line access to all tasks available.
You can install globally by typing the following in your terminal:
npm install web-deploy-cli -g
To verified that it is successfully installed, run this:
web-deploy --version
You can use this command to deploy your static web application to AWS S3 bucket:
web-deploy --args=<values>
Arguments allowed are:
Argument | Type | Description |
---|---|---|
type |
String | The type of deployment, case-insensitive, value should be set to aws |
bucket |
String | The bucket name for AWS S3 |
profile |
String? | The profile name for AWS credentials (if nothing is passed, profile will be set to default ) |
dir |
String? | The absolute path to your project directory (if nothing is passed, it will use the current directory of the terminal process) |
folder |
String? | Specify the folder that contains the built static web application i.e. build |
Example usage of arguments:
web-deploy --type=aws --bucket=john-doe-bucket --dir=/Users/johndoe/Projects/hello_world --folder=build
You will need to get an access token
from your Netlify account. See here for more information.
Create a new file .netlify.wdc.yml
under your project's root directory with this content:
accessToken: <enter_your_access_token_here>
You can use this command to deploy your static web application to Netlify:
web-deploy --args=<values>
Arguments allowed are:
Argument | Type | Description |
---|---|---|
type |
String | The type of deployment, case-insensitive, value should be set to netlify |
siteId |
String | The site's ID (API ID, can be found under site settings in Netlify) |
dir |
String? | The absolute path to your project directory (if nothing is passed, it will use the current directory of the terminal process) |
folder |
String? | Specify the folder that contains the built static web application i.e. build |
Example usage of arguments:
web-deploy --type=netlify --siteId=12345678 --dir=/Users/johndoe/Projects/hello_world --folder=build
Please refer to the Github releases section for the changelog
Install dependencies:
yarn install
Run examples:
yarn start
Run unit tests:
yarn unit
Run integration tests:
yarn integration
Watch unit tests:
yarn test:unit
Watch unit integration:
yarn test:integration
Watch all tests:
yarn test
Author: Jazz Peh <[email protected]> © 2019
License: MIT - do anything with the code, but don't blame me if it does not work.
Support: if you find any problems with this module, email / tweet / open issue on Github
Copyright (c) 2019 Jazz Peh (twitter: @jazzpeh) Licensed under the MIT license.