feat: 0328 #66
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
name: DeployTX | |
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: '111.230.199.157' | |
user: 'root' | |
pass: ${{ secrets.FTP_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 |