update:persional information #23
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions | |
name: Node.js CI | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
env: | |
SERVER_PRIVATE_KEY: ${{ secrets.SERVER_PRIVATE_KEY }} # 服务器私钥 | |
SERVER_HOST: ${{ secrets.REMOTE_HOST }} # 服务器IP地址 | |
USER_NAME: ${{ secrets.REMOTE_USER }} # 服务器用户名 | |
PORT: ${{secrets.REMOTE_PORT}} | |
cache-name: note | |
SERVER_PRIVATE_KEY1: ${{ secrets.SERVER_PRIVATE_KEY1 }} # 服务器私钥 | |
SERVER_HOST1: ${{ secrets.REMOTE_HOST1 }} # 服务器IP地址 | |
USER_NAME1: ${{ secrets.REMOTE_USER1 }} # 服务器用户名 | |
PORT1: ${{secrets.REMOTE_PORT1}} | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [16.x] | |
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/ | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
cache: 'npm' | |
- run: npm install | |
- run: npm run build | |
- run: | | |
echo $PATH | |
node -v | |
pwd | |
ls -l | |
- name: ssh deploy bandwagong | |
# You may pin to the exact commit or the version. | |
# uses: easingthemes/ssh-deploy@c711f2c3391cac2876bf4c833590077f02e4bcb8 | |
uses: easingthemes/[email protected] | |
with: | |
# Private Key | |
SSH_PRIVATE_KEY: ${{env.SERVER_PRIVATE_KEY}} | |
# Remote host | |
REMOTE_HOST: ${{env.SERVER_HOST}} | |
# Remote user | |
REMOTE_USER: ${{env.USER_NAME}} | |
# Remote port | |
REMOTE_PORT: ${{env.PORT}} | |
# Source directory | |
SOURCE: 'public/' | |
# Target directory | |
TARGET: '/app/blog/' | |
EXCLUDE: "/dist/, /node_modules/" | |
- name: ssh deploy aliyun | |
# You may pin to the exact commit or the version. | |
# uses: easingthemes/ssh-deploy@c711f2c3391cac2876bf4c833590077f02e4bcb8 | |
uses: easingthemes/[email protected] | |
with: | |
# Private Key | |
SSH_PRIVATE_KEY: ${{env.SERVER_PRIVATE_KEY1}} | |
# Remote host | |
REMOTE_HOST: ${{env.SERVER_HOST1}} | |
# Remote user | |
REMOTE_USER: ${{env.USER_NAME1}} | |
# Remote port | |
REMOTE_PORT: ${{env.PORT1}} | |
# Source directory | |
SOURCE: 'public/' | |
# Target directory | |
TARGET: '/app/blog/' | |
EXCLUDE: "/dist/, /node_modules/" | |