Skip to content

feat: 0317

feat: 0317 #58

Workflow file for this run

name: DeployAli
on:
push:
branches:
- main
env:
TARGET_DIR: /www/web/learn
jobs:
deploy:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x]
steps:
- name: Checkout # 步骤1
uses: actions/checkout@v3 # 使用的动作。格式:userName/repoName。作用:检出仓库,获取源码。 官方actions库:https://github.com/actions
- name: Use Node.js # 步骤2
uses: actions/setup-node@v3 # 作用:安装nodejs
with:
node-version: ${{ matrix.node-version }} # 版本
- run: npm install
- name: Build
run: npm run docs:build
- name: Deploy Server
uses: cross-the-world/ssh-scp-ssh-pipelines@latest
env:
WELCOME: 'ssh scp ssh pipelines CPP server'
LASTSSH: 'after copying success'
with:
host: '47.101.50.136'
user: 'root'
pass: ${{ secrets.ALI_PASSWORD }}
connect_timeout: 20s
first_ssh: |-
rm -rf $TARGET_DIR
echo $WELCOME
mkdir -p $TARGET_DIR
scp: |-
'./docs-dist/*' => $TARGET_DIR/
last_ssh: |-
echo $LASTSSH