File tree 4 files changed +21
-13
lines changed
4 files changed +21
-13
lines changed Original file line number Diff line number Diff line change 69
69
if : env.COS_SECRET_ID
70
70
env :
71
71
COS_SECRET_KEY : ${{secrets.COS_SECRET_KEY}}
72
- run : ./docs/pure -caches
72
+ run : ./docs/purge -caches
Original file line number Diff line number Diff line change 4
4
"dev" : " vitepress dev" ,
5
5
"build" : " vitepress build" ,
6
6
"serve" : " vitepress serve" ,
7
- "pure-caches" : " ./pure -caches" ,
7
+ "pure-caches" : " ./purge -caches" ,
8
8
"preinstall" : " npx only-allow pnpm"
9
9
},
10
10
"dependencies" : {
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ #!/usr/bin/env node
2
+
3
+ const { default : TenYun } = require ( 'tenyun' ) ;
4
+
5
+ const tc = new TenYun ( process . env . COS_SECRET_ID ?? '' , process . env . COS_SECRET_KEY ?? '' ) ;
6
+
7
+ tc . cdn . PurgePathCache ( {
8
+ Paths : [ process . env . domain ?? '' ] ,
9
+ FlushType : 'flush' ,
10
+ } )
11
+ . then ( ( { data } ) => {
12
+ console . log ( data ) ;
13
+
14
+ return tc . cdn . DescribePurgeTasks ( {
15
+ TaskId : data . TaskId ,
16
+ PurgeType : 'path' ,
17
+ } ) ;
18
+ } )
19
+ . then ( ( { data } ) => console . log ( data ) ) ;
You can’t perform that action at this time.
0 commit comments