semantic-release plugin to deploy app with netlify
Step | Description |
---|---|
verifyConditions |
Verify the presence of the NETLIFY_AUTH_TOKEN and NETLIFY_SITE_ID environment variable. |
publish |
Upload assets to netlify. |
npm i -D @eclass/semantic-release-netlify
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-netlify"
]
}
The netlify authentication configuration is required and can be set via environment variables.
Variable | Description |
---|---|
NETLIFY_AUTH_TOKEN |
Netlify token created via personal access tokens |
NETLIFY_SITE_ID |
Netlify site ID created via netlify sites:create |
{
"plugins": [
"@semantic-release/changelog",
"@semantic-release/npm",
"@semantic-release/git",
"@semantic-release/gitlab",
"@eclass/semantic-release-netlify"
]
}
# .gitlab-ci.yml
release:
image: node:11-alpine
stage: release
before_script:
- npm i -g netlify-cli
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 netlify-cli
script: npx semantic-release