Skip to content

Workflow file for this run

# This is a basic workflow to help you get started with Actions
name: Deploy To Server
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the main branch
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
deploy-gh-pages:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
# if your docs needs submodules, uncomment the following line
# submodules: true
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 7
run_install: true
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 16
cache: pnpm
- name: Install Deps
run: pnpm install --frozen-lockfile
- name: Build Docs
env:
NODE_OPTIONS: --max_old_space_size=4096
run: pnpm run build:vite
# https://github.com/marketplace/actions/ssh-deploy
- name: Deploy to Server
uses: easingthemes/ssh-deploy@v2.1.5
env:
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
ARGS: "--delete"
SOURCE: "docs/.vuepress/dist/"
REMOTE_HOST: ${{ secrets.REMOTE_HOST }}
REMOTE_USER: ${{ secrets.REMOTE_USER }}
TARGET: ${{ secrets.REMOTE_TARGET }}