|
23 | 23 |
|
24 | 24 |
|
25 | 25 | jobs: |
26 | | - install-init: |
27 | | - name: "流水线初始化" |
28 | | - runs-on: ubuntu-latest |
| 26 | + ## 部署到Github-Pages |
| 27 | + deploy-github: |
| 28 | + name: "部署到Github-Pages" |
| 29 | + runs-on: macos-latest |
29 | 30 |
|
30 | 31 | steps: |
31 | 32 | - name: Checkout Code |
32 | | - uses: actions/checkout@v3 |
| 33 | + uses: actions/checkout@v4 |
33 | 34 | with: |
| 35 | + persist-credentials: false |
34 | 36 | # “最近更新时间” 等 git 日志相关信息,需要拉取全部提交记录 |
35 | 37 | fetch-depth: 0 |
36 | 38 |
|
| 39 | + ## 依赖下载完成后,或执行思维导图编译 |
37 | 40 | - name: PNPM Install |
38 | 41 | uses: pnpm/action-setup@v2 |
39 | 42 | with: |
40 | 43 | version: 7 |
41 | | - run_install: true |
42 | | - |
43 | | - - name: Install Node.js |
44 | | - uses: actions/setup-node@v3 |
45 | | - with: |
46 | | - node-version: 16.20.2 |
47 | | - cache: 'pnpm' |
48 | | - |
49 | | - - name: Cache Dependencies |
50 | | - uses: actions/cache@v3 |
51 | | - with: |
52 | | - path: | |
53 | | - node_modules |
54 | | - key: ${{ runner.os }}-node_modules-${{ hashFiles('**/pnpm-lock.yaml') }} |
55 | | - |
56 | | - ## 部署到Github-Pages |
57 | | - deploy-github: |
58 | | - name: "部署到Github-Pages" |
59 | | - needs: install-init |
60 | | - runs-on: ubuntu-latest |
61 | | - |
62 | | - steps: |
63 | | - - name: Checkout Code |
64 | | - uses: actions/checkout@v3 |
65 | | - with: |
66 | | - fetch-depth: 0 |
67 | | - |
68 | | - - name: Restore Dependencies From cache |
69 | | - uses: actions/cache@v3 |
70 | | - with: |
71 | | - path: | |
72 | | - node_modules |
73 | | - key: ${{ runner.os }}-node_modules-${{ hashFiles('**/pnpm-lock.yaml') }} |
74 | | - |
| 44 | + run_install: | |
| 45 | + args: [--frozen-lockfile, --registry=https://registry.npmmirror.com] |
75 | 46 |
|
76 | 47 | # 运行构建脚本 |
77 | 48 | - name: Build VuePress Site |
78 | | - run: ./scripts/bundle build_proxy |
| 49 | + run: | |
| 50 | + ./scripts/bundle build_proxy |
79 | 51 |
|
| 52 | + ## 部署到Github Pages |
80 | 53 | - name: Deploy To GitHub Page |
81 | 54 | uses: crazy-max/ghaction-github-pages@v3 |
82 | 55 | with: |
|
89 | 62 | # deploy-vercel: |
90 | 63 | # name: "部署到Vercel平台" |
91 | 64 | # needs: install-init |
92 | | -# runs-on: ubuntu-latest |
| 65 | +# runs-on: macos-latest |
93 | 66 | # if: github.repository == '142vip/JavaScriptCollection' |
94 | 67 | # steps: |
95 | 68 | # - name: Checkout Code |
@@ -117,18 +90,17 @@ jobs: |
117 | 90 | ## 版本发布 |
118 | 91 | release: |
119 | 92 | name: "创建Github发布" |
120 | | - runs-on: ubuntu-latest |
121 | | - needs: install-init |
| 93 | + runs-on: macos-latest |
122 | 94 | ## 主库master、next且执行release更新时执行 |
123 | 95 | if: github.repository == '142vip/JavaScriptCollection' && startsWith(github.event.head_commit.message, 'chore(release):') |
124 | 96 |
|
125 | 97 | steps: |
126 | | - - name: Restore Dependencies From cache |
127 | | - uses: actions/cache@v3 |
| 98 | + - name: Checkout Code |
| 99 | + uses: actions/checkout@v4 |
128 | 100 | with: |
129 | | - path: | |
130 | | - node_modules |
131 | | - key: ${{ runner.os }}-node_modules-${{ hashFiles('**/pnpm-lock.yaml') }} |
| 101 | + persist-credentials: false |
| 102 | + # “最近更新时间” 等 git 日志相关信息,需要拉取全部提交记录 |
| 103 | + fetch-depth: 0 |
132 | 104 |
|
133 | 105 | ### 打成压缩包 |
134 | 106 | - name: Create Zip Package |
@@ -172,7 +144,7 @@ jobs: |
172 | 144 | # Deploy-ESC: |
173 | 145 | # name: "部署到ESC服务器" |
174 | 146 | # needs: install-init |
175 | | -# runs-on: ubuntu-latest |
| 147 | +# runs-on: macos-latest |
176 | 148 | # ## 主库master、next且执行release更新时执行 |
177 | 149 | # if: github.repository == '142vip/JavaScriptCollection' && startsWith(github.event.head_commit.message, 'chore(release):') |
178 | 150 | # |
|
0 commit comments