web-static-deploy

1.2.8 • Public • Published

web-static-deploy

Automate the deployment of local static resources to a remote server.

上传图片

Installation

To install the package, use the following command:

npm install web-static-deploy

Usage

  1. Create a file named deploy.js in the root directory of your project.
const webStaticDeploy = require('web-static-deploy')
webStaticDeploy(options)

The options object can include the following properties:

  • destination
    • host: The IP address of the server.
    • username: The authentication username. Default is root.
    • port(optional): The port number of the server. Default is 22.
    • privateKeyPath(optional): The local path to the client's private key. If not specified, the system's default SSH key at "ssh/id_rsa" will be used.
    • localPath: The local file path to the resources you want to upload (e.g., "dist").
    • remotePath: The destination path on the server where the files will be uploaded (e.g., "/var/www/***").
    • openURL(optional): The URL where you can access the deployed content once it's uploaded.
  1. Add a deployment script to your package.json:
  "scripts": {
    "deploy": "node deploy.js"
  }

Now you can run the deployment script using:

  npm run deploy

Make sure you've configured the options object in your deploy.js file according to your server settings and project structure. This setup will help you automate the process of deploying static resources to your remote server.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.2.8
    0
    • latest

Version History

Package Sidebar

Install

npm i web-static-deploy

Weekly Downloads

0

Version

1.2.8

License

none

Unpacked Size

6.26 kB

Total Files

3

Last publish

Collaborators

  • chenhaifei