https://github.com/eclass/semantic-release-now
semantic-release plugin to publish a static site with now.sh
https://github.com/eclass/semantic-release-now
eclass now-sh semantic-release semantic-release-plugin
Last synced: 8 months ago
JSON representation
semantic-release plugin to publish a static site with now.sh
- Host: GitHub
- URL: https://github.com/eclass/semantic-release-now
- Owner: eclass
- License: mit
- Created: 2019-03-14T20:50:45.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2024-11-19T11:08:54.000Z (over 1 year ago)
- Last Synced: 2024-11-19T12:36:45.083Z (over 1 year ago)
- Topics: eclass, now-sh, semantic-release, semantic-release-plugin
- Language: JavaScript
- Size: 1.13 MB
- Stars: 1
- Watchers: 4
- Forks: 1
- Open Issues: 47
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# @eclass/semantic-release-now
[](https://www.npmjs.com/package/@eclass/semantic-release-now)
[](https://travis-ci.org/eclass/semantic-release-now)
[](https://www.npmjs.com/package/@eclass/semantic-release-now)
[](https://david-dm.org/eclass/semantic-release-now)
[](https://david-dm.org/eclass/semantic-release-now#info=devDependencies)
[](https://coveralls.io/github/eclass/semantic-release-now?branch=master)
[](https://codeclimate.com/github/eclass/semantic-release-now/maintainability)
[](https://github.com/semantic-release/semantic-release)
> [semantic-release](https://github.com/semantic-release/semantic-release) plugin to deploy app with [now.sh](https://now.sh)
| Step | Description |
|--------------------|--------------------------------------------------------------|
| `verifyConditions` | Verify the presence of the `NOW_TOKEN` environment variable. |
| `publish` | Upload assets to now.sh. |
## Install
```bash
npm i -D @eclass/semantic-release-now
```
## Usage
The plugin can be configured in the [**semantic-release** configuration file](https://github.com/semantic-release/semantic-release/blob/caribou/docs/usage/configuration.md#configuration):
```json
{
"plugins": [
"@semantic-release/changelog",
"@semantic-release/npm",
"@semantic-release/git",
"@semantic-release/gitlab",
"@eclass/semantic-release-now"
]
}
```
## Configuration
### Now authentication
The now authentication configuration is **required** and can be set via [environment variables](#environment-variables).
### Environment variables
| Variable | Description |
| ----------- | --------------------------------------------------------------------------------------- |
| `NOW_TOKEN` | Now token created via [now token](https://zeit.co/account/tokens) |
### Now CLI
Is **required** install [now cli](https://www.npmjs.com/package/now) in CI.
### Examples
```json
{
"plugins": [
"@semantic-release/changelog",
"@semantic-release/npm",
"@semantic-release/git",
"@semantic-release/gitlab",
"@eclass/semantic-release-now"
]
}
```
```json
{
"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"]
}
```
```yml
# .gitlab-ci.yml
release:
image: node:11-alpine
stage: release
before_script:
- npm i -g --unsafe-perm now
script:
- npx semantic-release
only:
- master
```
```yml
# .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
```
## License
[MIT](https://tldrlegal.com/license/mit-license)