1
- # This is a basic workflow to help you get started with Actions
2
-
3
- name : update github page
1
+ name : Update GitHub page
4
2
5
3
env :
6
4
github-registry : https://npm.pkg.github.com
13
11
push :
14
12
branches :
15
13
- main
16
- # schedule:
17
- # - cron: '0 4 * * *'
18
- # workflow_call:
19
14
workflow_dispatch :
20
15
21
16
jobs :
@@ -27,36 +22,31 @@ jobs:
27
22
# https://github.com/pnpm/action-setup#use-cache-to-reduce-installation-time
28
23
- uses : actions/setup-node@v4
29
24
with :
30
- node-version : 16
25
+ node-version : 20
31
26
registry-url : " ${{env.npmjs-registry}}"
32
27
scope : " @${{env.scope}}"
28
+
33
29
- uses : pnpm/action-setup@v4
34
30
id : pnpm-install
35
31
with :
36
- version : 8
32
+ version : 9
37
33
run_install : false
34
+
38
35
- name : Get pnpm store directory
39
36
id : pnpm-cache
40
37
shell : bash
41
38
run : echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
39
+
42
40
- uses : actions/cache@v4
43
41
with :
44
42
path : ${{ steps.pnpm-cache.outputs.STORE_PATH }}
45
- key : ${{ runner.os }}-pnpm-store # -${{ hashFiles('**/pnpm-lock.yaml') }}
43
+ key : ${{ runner.os }}-pnpm-store
46
44
restore-keys : |
47
45
${{ runner.os }}-pnpm-store
48
46
49
- # - name: Build doc
50
- # env:
51
- # NODE_AUTH_TOKEN: ${{env.token}}
52
- # run: |
53
- # pnpm install --no-frozen-lockfile
54
- # npm run build
55
- # working-directory: dev
56
-
57
47
- uses : actions/setup-node@v4
58
48
with :
59
- node-version : 18
49
+ node-version : 20
60
50
registry-url : " ${{env.github-registry}}"
61
51
scope : " @${{env.scope}}"
62
52
@@ -68,12 +58,11 @@ jobs:
68
58
npm pack @${{env.scope}}/designer@^1
69
59
tar -xzvf public-ui-designer-*.tgz
70
60
71
- rm -rf ../docs /v1/designer
72
- mkdir -p ../docs /v1
73
- mv package/dist ../docs /v1/designer
61
+ rm -rf build /v1/designer
62
+ mkdir -p build /v1
63
+ mv package/dist build /v1/designer
74
64
75
65
rm -rf package *.tgz
76
- working-directory : dev
77
66
78
67
- name : Download sample react (v1)
79
68
env :
@@ -83,12 +72,11 @@ jobs:
83
72
npm pack @${{env.scope}}/sample-react@^1
84
73
tar -xzvf public-ui-sample-react-*.tgz
85
74
86
- rm -rf ../docs /v1/sample-react
87
- mkdir -p ../docs /v1
88
- mv package/dist ../docs /v1/sample-react
75
+ rm -rf build /v1/sample-react
76
+ mkdir -p build /v1
77
+ mv package/dist build /v1/sample-react
89
78
90
79
rm -rf package *.tgz
91
- working-directory : dev
92
80
93
81
- name : Download designer (v2)
94
82
env :
@@ -98,12 +86,11 @@ jobs:
98
86
npm pack @${{env.scope}}/designer@^2
99
87
tar -xzvf public-ui-designer-*.tgz
100
88
101
- rm -rf ../docs /v2/designer
102
- mkdir -p ../docs /v2
103
- mv package/dist ../docs /v2/designer
89
+ rm -rf build /v2/designer
90
+ mkdir -p build /v2
91
+ mv package/dist build /v2/designer
104
92
105
93
rm -rf package *.tgz
106
- working-directory : dev
107
94
108
95
- name : Download sample react (v2)
109
96
env :
@@ -113,48 +100,13 @@ jobs:
113
100
npm pack @${{env.scope}}/sample-react@^2
114
101
tar -xzvf public-ui-sample-react-*.tgz
115
102
116
- rm -rf ../docs /v2/sample-react
117
- mkdir -p ../docs /v2
118
- mv package/dist ../docs /v2/sample-react
103
+ rm -rf build /v2/sample-react
104
+ mkdir -p build /v2
105
+ mv package/dist build /v2/sample-react
119
106
120
107
rm -rf package *.tgz
121
- working-directory : dev
122
-
123
- # - name: Download slidev
124
- # env:
125
- # NODE_AUTH_TOKEN: ${{env.token}}
126
- # run: |
127
- # rm -rf package *.tgz
128
- # npm pack @${{env.scope}}/slidev
129
- # tar -xzvf public-ui-slidev-*.tgz
130
- # mv package/dist build/presentation
131
- # mv package/presentation.pdf build/presentation/presentation.pdf
132
- # rm -rf package *.tgz
133
- # ls -la build
134
- # working-directory: dev
135
-
136
- # - name: Download storybook
137
- # env:
138
- # NODE_AUTH_TOKEN: ${{env.token}}
139
- # run: |
140
- # rm -rf package *.tgz
141
- # npm pack @${{env.scope}}/storybook
142
- # tar -xzvf public-ui-storybook-*.tgz
143
- # mv package/dist build/storybook
144
- # rm -rf package *.tgz
145
- # ls -la build
146
- # working-directory: dev
147
-
148
- - name : Commit changed files
149
- continue-on-error : true
150
- run : |
151
- git config --local user.email "action@github.com"
152
- git config --local user.name "GitHub Action"
153
- git add .
154
- git status
155
- git commit -m "Auto update github page"
156
108
157
- - uses : ad-m/github-push-action@master
109
+ - name : Upload GitHub Pages artifact
110
+ uses : actions/upload-pages-artifact@v3.0.1
158
111
with :
159
- github_token : ${{ secrets.GITHUB_TOKEN }}
160
- force : true
112
+ path : build
0 commit comments