semantic-release plugin to deploy app with now.sh
Step | Description |
---|---|
verifyConditions |
Verify the presence of the NOW_TOKEN environment variable. |
publish |
Upload assets to now.sh. |
npm i -D @eclass/semantic-release-now
The plugin can be configured in the semantic-release configuration file:
{
"plugins": [
"@semantic-release/changelog",
"@semantic-release/npm",
"@semantic-release/git",
"@semantic-release/gitlab",
"@eclass/semantic-release-now"
]
}
The now authentication configuration is required and can be set via environment variables.
Variable | Description |
---|---|
NOW_TOKEN |
Now token created via now token |
Is required install now cli in CI.
{
"plugins": [
"@semantic-release/changelog",
"@semantic-release/npm",
"@semantic-release/git",
"@semantic-release/gitlab",
"@eclass/semantic-release-now"
]
}
{
"version": 2,
"name": "my-awesome-project",
"builds": [
{
"src": "build/**/*",
"use": "@now/static"
}
],
"routes": [
{
"src": "/(.*)",
"headers": {
"cache-control": "s-maxage=0"
},
"dest": "build/index.html"
}
],
"alias": ["my-awesome-project.now.sh"]
}
# .gitlab-ci.yml
release:
image: node:11-alpine
stage: release
before_script:
- npm i -g --unsafe-perm now
script:
- npx semantic-release
only:
- master
# .travis.yml
language: node_js
cache:
directories:
- ~/.npm
node_js:
- "11"
stages:
- test
- name: deploy
if: branch = master
jobs:
include:
- stage: test
script: npm t
- stage: deploy
before_script:
- npm i -g --unsafe-perm now
script: npx semantic-release