surge-preview
v1.0.10
Published
Publish static assets to surge and sets a status to github pull requests
Downloads
2
Readme
surge-preview
Publish static assets to surge and sets a status to Github pull requests. Plays well with Drone, Circle or Travis CI.
CI Usage
Install it as an CI step: npm install surge-preview -g
or yarn global add surge-preview
- Create a surge.sh account and install surge on your local machine
- Generate a Github Personal Access Token that is scoped to
repo:status
- Generate a
SURGE_TOKEN
- Set
SURGE_LOGIN
,SURGE_TOKEN
andGITHUB_TOKEN
in your CI environment - Add
surge-preview
to your CI yaml file, specify your folder and call it after your assets are generated within the CI
You can specify any parameter as an atribute:
Usage
$ surge-preview <folder> [options]
Inputs
<folder> Folder to be published, defaults to './dist'
Options
--domain domain to publish, defaults to '#sha.surge.sh'
--surge-login surge login, defaults to 'env.SURGE_LOGIN'
--surge-token surge token, defaults to 'env.SURGE_TOKEN'
--hash commit hash, defaults to CI env
--github-token Github Token, defaults to 'env.GITHUB_TOKEN'
--repo Github repository, defaults to CI env
Notes
surge-preview
is desigend as an optional CI step and will always exits with status 0 to keep the following CI steps running.In an CI aviod adding tokens or logins as parameters. Use CI environment variables to store them as a secret.
Remixes
Install and use it as a package dependency: npm install surge-preview --save
or yarn add surge-preview
All steps are asynchronous and will return a promise. Have a look at steps/
to require github and surge functionality.