Skip to content

改了访问地址

改了访问地址 #2

Workflow file for this run

# 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://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
name: build-deploy
on:
push:
tags:
- 'release-*' # 匹配以 release- 开头的标签,例如 release-20240101
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: master
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: '18.x'
- name: test ssh
uses: appleboy/[email protected]
with:
host: ${{ secrets.REMOTE_HOST }}
username: ${{ secrets.REMOTE_USER }}
key: ${{ secrets.ACCESS_TOKEN }}
port: 22
script: |
whoami
echo "ssh正常连接"
- name: Install npm dependencies
run: npm ci
- name: Run build web task
run: npm run build --if-present
- name: Run build doc task
run: npm run docs:build --if-present
- name: Deploy web to Server
uses: easingthemes/ssh-deploy@main
with:
SSH_PRIVATE_KEY: ${{ secrets.ACCESS_TOKEN }}
ARGS: '-rlgoDzvc -i --delete'
SOURCE: 'dist/'
REMOTE_HOST: ${{ secrets.REMOTE_HOST }}
REMOTE_USER: ${{ secrets.REMOTE_USER }}
TARGET: ${{ vars.REMOTE_DIR }}/web
EXCLUDE: ''
- name: Deploy doc to Server
uses: easingthemes/ssh-deploy@main
with:
SSH_PRIVATE_KEY: ${{ secrets.ACCESS_TOKEN }}
ARGS: '-rlgoDzvc -i --delete'
SOURCE: 'docs/.vitepress/dist/'
REMOTE_HOST: ${{ secrets.REMOTE_HOST }}
REMOTE_USER: ${{ secrets.REMOTE_USER }}
TARGET: ${{ vars.REMOTE_DIR }}/doc
EXCLUDE: ''