mirror of
https://hub.gitmirror.com/https://github.com/ExamAware/ExamAware-docs
synced 2025-04-29 07:56:39 +00:00
fix: 更新部署文档工作流,添加打包工件步骤并调整上传路径
This commit is contained in:
parent
044a022e98
commit
50f5cddcdb
36
.github/workflows/deploy-docs.yml
vendored
36
.github/workflows/deploy-docs.yml
vendored
@ -1,3 +1,4 @@
|
||||
|
||||
name: 部署文档
|
||||
|
||||
on:
|
||||
@ -24,6 +25,7 @@ jobs:
|
||||
with:
|
||||
version: 9.9.0+sha512.60c18acd138bff695d339be6ad13f7e936eea6745660d4cc4a776d5247c540d0edee1a563695c183a66eb917ef88f2b4feb1fc25f32a7adcadc7aaf3438e99c1
|
||||
|
||||
|
||||
- name: 设置 Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
@ -42,28 +44,44 @@ jobs:
|
||||
pnpm run docs:build
|
||||
> src/.vuepress/dist/.nojekyll
|
||||
|
||||
- name: 打包工件
|
||||
shell: sh
|
||||
if: runner.os == 'Linux'
|
||||
run: |
|
||||
tar \
|
||||
--directory "./src/.vuepress/dist/" \
|
||||
-cvf "$RUNNER_TEMP/artifact.tar" \
|
||||
--exclude=.git \
|
||||
--exclude=.github \
|
||||
.
|
||||
env:
|
||||
INPUT_PATH: ./build
|
||||
|
||||
- name: 上传工件
|
||||
uses: actions/upload-artifact@v4
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: github-pages
|
||||
path: src/.vuepress/dist
|
||||
path: ${{ runner.temp }}/artifact.tar
|
||||
retention-days: 1
|
||||
if-no-files-found: error
|
||||
|
||||
deploy:
|
||||
# Add a dependency to the build job
|
||||
needs: build
|
||||
|
||||
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
|
||||
permissions:
|
||||
pages: write
|
||||
id-token: write
|
||||
pages: write # to deploy to Pages
|
||||
id-token: write # to verify the deployment originates from an appropriate source
|
||||
|
||||
# Deploy to the github-pages environment
|
||||
environment:
|
||||
name: github-pages
|
||||
url: ${{ steps.deployment.outputs.page_url }}
|
||||
|
||||
# Specify runner + deployment step
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: 下载工件
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: github-pages
|
||||
- name: 部署到 GitHub Pages
|
||||
id: deployment
|
||||
uses: actions/deploy-pages@v3
|
||||
uses: actions/deploy-pages@v2 # or the latest "vX.X.X" version tag for this action
|
Loading…
x
Reference in New Issue
Block a user