Skip to content

Commit

Permalink
🐎 ci: 提供文档部署配置;
Browse files Browse the repository at this point in the history
  • Loading branch information
ruan-cat committed Jul 15, 2024
1 parent 3626f59 commit 142c71b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
8 changes: 8 additions & 0 deletions .github/workflows/use-vercel-cli-build-try-4.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ env:
p3: ./packages/monorepo-3
p4: ./packages/monorepo-4
p5: ./packages/monorepo-5
docs01Star: ./packages/docs-01-star

# 项目url
p1-url: monorepo-1.ruancat6312.top
Expand All @@ -34,6 +35,8 @@ env:
p5-url-1: monorepo-5.ruancat6312.top
p5-url-2: monorepo5.ruan-cat.com

docs-01-star-url: docs-01-star.ruancat6312.top

on:
push:
branches:
Expand Down Expand Up @@ -70,6 +73,7 @@ jobs:
vc link --yes --cwd=${{env.p3}} --project=${{env.pjn}} -t ${{env.vct}}
vc link --yes --cwd=${{env.p4}} --project=${{env.pjn}} -t ${{env.vct}}
vc link --yes --cwd=${{env.p5}} --project=${{env.pjn}} -t ${{env.vct}}
vc link --yes --cwd=${{env.docs01Star}} --project=${{env.pjn}} -t ${{env.vct}}
- name: vercel生成特定.vercel/output/static目录
# build命令仍然需要用token来运行。
Expand All @@ -80,6 +84,7 @@ jobs:
vc build --yes --prod --cwd=${{env.p3}} -A ./vercel.null.json -t ${{env.vct}}
vc build --yes --prod --cwd=${{env.p4}} -A ./vercel.null.json -t ${{env.vct}}
vc build --yes --prod --cwd=${{env.p5}} -A ./vercel.null.json -t ${{env.vct}}
vc build --yes --prod --cwd=${{env.docs01Star}} -A ./vercel.null.json -t ${{env.vct}}
- name: turbo并发打包全部子项目
run: pnpm run on-github-action-flow
Expand All @@ -103,3 +108,6 @@ jobs:
url5="$(vc deploy --yes --prebuilt --prod --cwd=${{env.p5}} -t ${{env.vct}})"
vc alias -t ${{env.vct}} set "$url5" ${{env.p5-url-1}}
vc alias -t ${{env.vct}} set "$url5" ${{env.p5-url-2}}
url01Star="$(vc deploy --yes --prebuilt --prod --cwd=${{env.docs01Star}} -t ${{env.vct}})"
vc alias -t ${{env.vct}} set "$url01Star" ${{env.docs-01-star-url}}
4 changes: 3 additions & 1 deletion packages/docs-01-star/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
"scripts": {
"docs:dev": "vitepress dev docs --port 8080",
"build:docs": "vitepress build docs",
"docs:preview": "vitepress preview docs"
"docs:preview": "vitepress preview docs",
"copy-dist": "rimraf .vercel/output/static && mkdirp .vercel/output/static && cpx \"docs/.vitepress/dist/**/*\" .vercel/output/static && shx ls -R .vercel/output/static",
"clear": "rimraf dist && rimraf .turbo && rimraf .vercel"
},
"keywords": [],
"author": "",
Expand Down

0 comments on commit 142c71b

Please sign in to comment.