Skip to content

Commit 61a56e2

Browse files
committed
update deploy
1 parent 62fe057 commit 61a56e2

34 files changed

+3803
-3762
lines changed

.github/workflows/deploy.yml

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
1-
21
name: 部署文档
32

43
on:
54
push:
65
branches:
7-
- master # 只在master上push触发部署
6+
- docs # 只在 docs 上 push 触发部署
87
paths-ignore: # 下列文件的变更不触发部署,可以自行添加
98
- README.md
109
- LICENSE
1110
pull_request:
1211
branches:
13-
- master # 只在master上push触发部署
12+
- docs # 只在 docs 上 push 触发部署
1413
types: [closed]
1514

1615
permissions:
@@ -27,8 +26,6 @@ jobs:
2726
# 如果你文档需要 Git 子模块,取消注释下一行
2827
# submodules: true
2928

30-
31-
3229
- name: 设置 Node.js
3330
uses: actions/setup-node@v3
3431
with:
@@ -51,3 +48,32 @@ jobs:
5148
# 这是文档部署到的分支名称
5249
branch: gh-pages
5350
folder: src/.vuepress/dist
51+
52+
deploy-main:
53+
runs-on: ubuntu-latest
54+
55+
steps:
56+
- name: Checkout code
57+
uses: actions/checkout@v2
58+
59+
- name: Switch to main branch
60+
run: |
61+
git checkout main || git checkout --orphan main
62+
git rm -rf .
63+
64+
- name: Copy specific folders
65+
run: |
66+
cp -r src/outline/ ./
67+
cp -r src/ds/ ./
68+
cp -r src/algorithm/ ./
69+
cp -r src/problem/ ./
70+
cp -r src/README.md ./
71+
cp -r assets/image/leetcode-js-logo.png ./
72+
73+
- name: Commit and push changes
74+
run: |
75+
git config --local user.name "github-actions"
76+
git config --local user.email "github-actions@github.com"
77+
git add .
78+
git commit -m "Update main branch with src folders" || echo "No changes to commit"
79+
git push origin main

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
1+
dist/
22
node_modules/
33
src/.vuepress/.cache/
44
src/.vuepress/.temp/

assets/image/react-1.png

-115 KB
Binary file not shown.

assets/image/react-10.png

-188 KB
Binary file not shown.

assets/image/react-11.png

-126 KB
Binary file not shown.

assets/image/react-12.png

-234 KB
Binary file not shown.

assets/image/react-13.png

-247 KB
Binary file not shown.

assets/image/react-14.png

-191 KB
Binary file not shown.

assets/image/react-2.png

-139 KB
Binary file not shown.

assets/image/react-3.png

-121 KB
Binary file not shown.

0 commit comments

Comments
 (0)