File tree Expand file tree Collapse file tree 2 files changed +25
-7
lines changed
Expand file tree Collapse file tree 2 files changed +25
-7
lines changed Original file line number Diff line number Diff line change @@ -126,6 +126,20 @@ jobs:
126126 --secret-key ${{ secrets.TENCENTCLOUD_SECRET_KEY }} \
127127 --endpoint cos.na-ashburn.myqcloud.com \
128128 --delete \
129+ --exclude ".*\.md$" \
130+ --force
131+
132+ - name : Deploy md to COS
133+ run : |
134+ ./coscli sync public/ cos://${{ secrets.TENCENTCLOUD_BUCKET_ID }} \
135+ --init-skip \
136+ --recursive \
137+ --routines 16 \
138+ --secret-id ${{ secrets.TENCENTCLOUD_SECRET_ID }} \
139+ --secret-key ${{ secrets.TENCENTCLOUD_SECRET_KEY }} \
140+ --endpoint cos.na-ashburn.myqcloud.com \
141+ --include ".*\.md$" \
142+ --meta="ContentType:text/plain; charset=utf-8" \
129143 --force
130144
131145 cdn-refresh :
Original file line number Diff line number Diff line change @@ -6,16 +6,20 @@ export const cpMarkdown = (
66 destpath : string ,
77 filename : string
88) => {
9- if ( ! filename ) {
10- return ;
11- }
129 const sourceDir = path . resolve (
1310 __dirname ,
1411 `../docs/markdown-pages/${ filepath } `
1512 ) ;
16- const destDir = path . resolve (
17- __dirname ,
18- `../public/${ destpath } /${ filename } .md`
19- ) ;
13+
14+ let _destpath = destpath ;
15+
16+ if ( ! filename ) {
17+ _destpath = destpath . endsWith ( "/" )
18+ ? destpath . slice ( 0 , destpath . length - 1 )
19+ : destpath ;
20+ }
21+
22+ const destDir = path . resolve ( __dirname , `../public/${ _destpath } .md` ) ;
23+
2024 fs . copy ( sourceDir , destDir ) . catch ( ( e ) => console . warn ( e . toString ( ) ) ) ;
2125} ;
You can’t perform that action at this time.
0 commit comments