Skip to content

Commit 266590c

Browse files
committed
ci: fix auto deploy site failed
1 parent 277de36 commit 266590c

File tree

3 files changed

+22
-9
lines changed

3 files changed

+22
-9
lines changed

.github/workflows/auto-deploy-site.yml

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ jobs:
2323
# Build job
2424
build:
2525
runs-on: ubuntu-latest
26+
permissions:
27+
contents: write
2628
steps:
2729
- name: Checkout
2830
uses: actions/checkout@v3
@@ -31,27 +33,30 @@ jobs:
3133
with:
3234
version: 9
3335
- name: Install deps
34-
run: pnpm -F @opentiny/vue-docs i --ignore-scripts --no-frozen-lockfile
36+
run: pnpm i --no-frozen-lockfile
3537
- name: Build site
36-
run: pnpm -F @opentiny/vue-docs build
38+
run: export NODE_OPTIONS="--max-old-space-size=8192" && pnpm -F @opentiny/vue-docs build
3739
- name: Setup Pages
38-
uses: actions/configure-pages@v2
40+
uses: actions/configure-pages@v5
3941
- name: Build with Jekyll
4042
uses: actions/jekyll-build-pages@v1
4143
with:
4244
source: ./examples/sites/dist
4345
destination: ./_site
46+
- run: sudo chmod -R 777 ./dist
47+
- run: cp ./examples/sites/dist/assets/_commonjsHelpers*.js ./_site/assets
48+
- run: cp ./_site/index.html ./_site/404.html
4449
- name: Upload artifact
45-
uses: actions/upload-pages-artifact@v1
50+
uses: actions/upload-pages-artifact@v3
4651

4752
# Deployment job
4853
deploy:
49-
environment:
50-
name: github-pages
51-
url: ${{ steps.deployment.outputs.page_url }}
5254
runs-on: ubuntu-latest
5355
needs: build
5456
steps:
5557
- name: Deploy to GitHub Pages
5658
id: deployment
57-
uses: actions/deploy-pages@v1
59+
uses: actions/deploy-pages@v4
60+
environment:
61+
name: github-pages
62+
url: ${{ steps.deployment.outputs.page_url }}

examples/sites/env/.env.pages

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# 1、声明一个变量
2+
VITE_CONTEXT=/tiny-vue/
3+
VITE_BUILD_TARGET='inner'
4+
# 官网应用类型:pc / mobile / mobile-first
5+
VITE_APP_MODE='pc'
6+
7+
VITE_APP_BUILD_BASE_URL='/tiny-vue/'
8+
VITE_PLAYGROUND_URL=/playground.html

examples/sites/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"build:saas:alpha": "vite build --mode innersaas",
1515
"build:saas:open": "vite build --mode saasopen",
1616
"build:saas:prod": "vite build --mode saasprod",
17-
"build": "vite build",
17+
"build": "vite build --mode pages",
1818
"build:open": "vite build --mode open",
1919
"prettier": "npx prettier --write ./**/*.{ts,tsx,css,less,scss,vue}",
2020
"stylelint": "npx stylelint ./src/**/*.scss ./src/**/*.less ./src/**/*.css --fix",

0 commit comments

Comments
 (0)