2020-09-14 17:15:06 +08:00
name : Deploy Docs
2020-09-14 16:55:43 +08:00
on :
2023-03-30 21:16:04 +08:00
push :
branches :
2023-03-31 16:03:15 +08:00
- master
2023-03-30 21:16:04 +08:00
paths :
- 'docs/**/**'
- 'package.json'
2020-09-14 16:55:43 +08:00
jobs :
2023-03-30 21:16:04 +08:00
build-and-deploy :
runs-on : ubuntu-latest
steps :
- name : Checkout
2023-03-31 18:27:14 +08:00
uses : actions/checkout@v3
2021-07-05 11:35:56 +08:00
2023-03-30 21:33:59 +08:00
- name : PNPM
uses : pnpm/action-setup@v2
with :
version : 8.1 .0
2023-03-30 21:16:04 +08:00
- name : Install and Build 🔧 # This example project is built using npm and outputs the result to the 'build' folder. Replace with the commands required to build your project, or remove this step entirely if your site is pre-built.
run : pnpm i && pnpm docs:build
- name : Deploy
uses : easingthemes/ssh-deploy@main
env :
# 本地.ssh文件下的私钥id_rsa, 存在secrets的TOKEN中
SSH_PRIVATE_KEY : ${{ secrets.HARRYWAN_PRIVATE_KEY }}
# 源目录,相对于$GITHUB_WORKSPACE根目录的路径
2023-04-24 15:59:04 +08:00
SOURCE : docs/.vitepress/dist/
2023-03-30 21:16:04 +08:00
# 服务器域名
REMOTE_HOST : ${{ secrets.TX_IP }}
# 腾讯云默认用户名为root
REMOTE_USER : root
# 目标目录
TARGET : /data/web-packages/p/fesjs
2023-03-31 16:03:15 +08:00
build-and-deploy-pages :
concurrency : ci-${{ github.ref }} # Recommended if you intend to make multiple deployments in quick succession.
runs-on : ubuntu-latest
steps :
- name : Checkout 🛎️
uses : actions/checkout@v3
2023-04-01 15:06:29 +08:00
- name : PNPM
uses : pnpm/action-setup@v2
with :
version : 8.1 .0
2023-03-31 16:03:15 +08:00
- name : Install and Build 🔧 # This example project is built using npm and outputs the result to the 'build' folder. Replace with the commands required to build your project, or remove this step entirely if your site is pre-built.
run : |
pnpm i
2023-04-10 14:50:09 +08:00
pnpm docs:build-pages
2023-03-31 16:03:15 +08:00
- name : Deploy 🚀
uses : JamesIves/github-pages-deploy-action@v4.3.3
with :
branch : gh-pages # The branch the action should deploy to.
2023-04-24 15:59:04 +08:00
folder : docs/.vitepress/dist
2023-03-31 16:03:15 +08:00
token : ${{ secrets.ACCESS_TOKEN }}