1. @eclass/semantic-release-surge
semantic-release plugin to publish a static site with surge.sh
@eclass/semantic-release-surge
Package: @eclass/semantic-release-surge
Created by: eclass
Last modified: Fri, 06 Oct 2023 18:23:56 GMT
Version: 1.1.0
License: MIT
Downloads: 68
Repository: https://github.com/eclass/semantic-release-surge

Install

npm install @eclass/semantic-release-surge
yarn add @eclass/semantic-release-surge

@eclass/semantic-release-surge

npm
build
downloads
dependencies
devDependency Status
Test Coverage
Maintainability
semantic-release

semantic-release plugin to publish a static site with surge.sh

Step Description
verifyConditions Verify the presence of the SURGE_TOKEN environment variable and SURGE_ALIAS environment variable or alias option.
prepare Build assets with a npm script.
publish Upload assets to surge.sh.

Install

 npm i -D @eclass/semantic-release-surge

Usage

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-surge"
  ]
}

Configuration

Surge authentication

The surge authentication configuration is required and can be set via environment variables.

Environment variables

Variable Description
SURGE_TOKEN Surge token created via surge token
SURGE_ALIAS Optional set surge alias. Example my-awesome-project.surge.sh
SURGE_CNAME Optional set surge custom CNAME. Example my-awesome-project.io

Options

Options Description Default
alias Set de custom alias to surge.sh project. null
buildScriptName npm script to build assets. build
build Indicate if is requerid build assets. false
asstes Indicate the assets directory. dist

Examples

The build and asstes option can be used to skip the build assets:

 {
  "plugins": [
    "@semantic-release/changelog",
    "@semantic-release/npm",
    "@semantic-release/git",
    "@semantic-release/gitlab",
    ["@semantic-release/exec", {
      "publishCmd": "npm run build"
    }],
    ["@eclass/semantic-release-surge", {
      "alias": "my-awesome-project.surge.sh",
      "assets": "build",
      "build": false,
    }]
  ]
}

Is posible specificate a custom npm script build and a custom CNAME:

 {
  "plugins": [
    "@semantic-release/changelog",
    "@semantic-release/npm",
    "@semantic-release/git",
    "@semantic-release/gitlab",
    ["@eclass/semantic-release-surge", {
      "alias": "my-awesome-project.surge.sh",
      "cname": "my-awesome-project.io",
      "buildScriptName": "build:client"
    }]
  ]
}
 {
  "scripts": {
    "build:client": "react-scripts build"
  }
}

License

MIT

RELATED POST

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin