mirror of
https://hub.gitmirror.com/https://github.com/ExamAware/ExamAware-docs
synced 2025-04-29 08:06:37 +00:00
63 lines
1.4 KiB
YAML
63 lines
1.4 KiB
YAML
name: 部署文档
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
# 如果你文档需要 Git 子模块,取消注释下一行
|
|
# submodules: true
|
|
|
|
- name: 设置 pnpm
|
|
uses: pnpm/action-setup@v4
|
|
with:
|
|
version: 9.9.0+sha512.60c18acd138bff695d339be6ad13f7e936eea6745660d4cc4a776d5247c540d0edee1a563695c183a66eb917ef88f2b4feb1fc25f32a7adcadc7aaf3438e99c1
|
|
|
|
- name: 设置 Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 20
|
|
cache: pnpm
|
|
|
|
- name: 安装依赖
|
|
run: |
|
|
corepack enable
|
|
pnpm install --frozen-lockfile
|
|
|
|
- name: 构建文档
|
|
env:
|
|
NODE_OPTIONS: --max_old_space_size=8192
|
|
run: |-
|
|
pnpm run docs:build
|
|
> src/.vuepress/dist/.nojekyll
|
|
|
|
- name: 上传工件
|
|
uses: actions/upload-pages-artifact@v1
|
|
with:
|
|
path: src/.vuepress/dist
|
|
retention-days: 1
|
|
|
|
deploy:
|
|
needs: build
|
|
permissions:
|
|
pages: write
|
|
id-token: write
|
|
environment:
|
|
name: github-pages
|
|
url: ${{ steps.deployment.outputs.page_url }}
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: 部署到 GitHub Pages
|
|
id: deployment
|
|
uses: actions/deploy-pages@v2 |