Merge pull request #1366 from didi/fix-no-splitchunks #1020
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: docs | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: technote-space/get-diff-action@v4 | |
with: | |
PATTERNS: | | |
+(docs|docs-vuepress)/**/* | |
+(docs|docs-vuepress)/.*/**/* | |
- uses: actions/setup-node@v1 | |
with: | |
node-version: '16' | |
# vuepress生成最终文档 | |
- name: generate docs file | |
if: env.GIT_DIFF | |
run: | | |
npm i | |
npm run docs:build | |
# 使用 https://github.com/appleboy/scp-action 进行部署,注意 strip_components 用于控制层级 | |
- name: Deploy to self-host server | |
if: env.GIT_DIFF | |
uses: appleboy/scp-action@master | |
with: | |
host: ${{ secrets.DOCS_SERVER_HOST }} | |
username: ${{ secrets.DOCS_SERVER_USER }} | |
key: ${{ secrets.DOCS_SERVER_KEY }} | |
command_timeout: "20m" | |
source: "./docs-vuepress/.vuepress/dist/" | |
strip_components: 4 | |
target: "${{ secrets.DOCS_SERVER_DIR }}" |