Skip to content

Commit

Permalink
feat: 优化workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
theajack committed Apr 6, 2022
1 parent eb53c3e commit 591cc42
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 8 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,6 @@ jobs:
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}

- name: Purge # purge cdn
run: node ./helper/purge-cdn.js
run: |
node ./helper/purge-cdn.js
node ./helper/purge-docs.js
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ cnchar.draw('你好', options); // options 为可选参数, 在5.2.2 种会详

运行结果如下:

![draw.jpg](https://cdn.jsdelivr.net/gh/theajack/cnchar/docs/assets/readme/draw.jpg)
![draw.jpg](https://cdn.jsdelivr.net/gh/theajack/cnchar@gh-pages/assets/readme/draw.jpg)

该库支持脱离cnchar 独立使用

Expand Down
2 changes: 1 addition & 1 deletion helper/README.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ cnchar.draw('你好', options); // options are optional parameters, detailed in

The results are as follows:

![draw.jpg](https://cdn.jsdelivr.net/gh/theajack/cnchar/docs/assets/readme/draw.jpg)
![draw.jpg](https://cdn.jsdelivr.net/gh/theajack/cnchar@gh-pages/assets/readme/draw.jpg)

The library supports independent use without cnchar

Expand Down
2 changes: 1 addition & 1 deletion helper/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ cnchar.draw('你好', options); // options 为可选参数, 在5.2.2 种会详

运行结果如下:

![draw.jpg](https://cdn.jsdelivr.net/gh/theajack/cnchar/docs/assets/readme/draw.jpg)
![draw.jpg](https://cdn.jsdelivr.net/gh/theajack/cnchar@gh-pages/assets/readme/draw.jpg)

该库支持脱离cnchar 独立使用

Expand Down
5 changes: 5 additions & 0 deletions helper/purge-docs.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const https = require('https');

https.get('https://purge.jsdelivr.net/gh/theajack/cnchar@gh-pages', () => {

});
4 changes: 2 additions & 2 deletions vuepress/.vuepress/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module.exports = {
if (NODE_ENV === 'production') {
return {
output: {
publicPath: 'https://cdn.jsdelivr.net/gh/theajack/cnchar@master/docs/'
publicPath: 'https://cdn.jsdelivr.net/gh/theajack/cnchar@gh-pages/'
// publicPath: '/docs/' // debug
},
resolve: {
Expand All @@ -36,7 +36,7 @@ module.exports = {
base: '/cnchar/', // gh-pages分支这里需要改成 / 因为 cnchar.js.org的配置
// 注入到当前页面的 HTML <head> 中的标签
head: [
['link', {rel: 'icon', href: 'https://cdn.jsdelivr.net/gh/theajack/cnchar/docs/assets/v1/images/i.ico'}], // 增加一个自定义的 favicon
['link', {rel: 'icon', href: 'https://cdn.jsdelivr.net/gh/theajack/cnchar@gh-pages/assets/v1/images/i.ico'}], // 增加一个自定义的 favicon
],
// dest: './dist', //打包位置
port: 6868, // 端口号
Expand Down
2 changes: 1 addition & 1 deletion vuepress/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<title>cnchar</title>
<meta name="description" content="功能全面、多端支持的汉字拼音笔画js库">
<meta name="generator" content="VuePress 1.4.0">
<link rel="icon" href="https://cdn.jsdelivr.net/gh/theajack/cnchar/docs/assets/v1/images/i.ico">
<link rel="icon" href="https://cdn.jsdelivr.net/gh/theajack/cnchar@gh-pages/assets/v1/images/i.ico">
</head>
<body>
<script>
Expand Down
2 changes: 1 addition & 1 deletion vuepress/src/jsbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ function main () {
}
if (jsbox._id !== _id || iframeId !== _id) {
jsbox._id = _id;
const config = (location.host.indexOf('localhost') !== -1) ? 'http://localhost:8080/config.js' : 'https://cdn.jsdelivr.net/gh/theajack/cnchar/docs/config.js';
const config = (location.host.indexOf('localhost') !== -1) ? 'http://localhost:8080/config.js' : 'https://cdn.jsdelivr.net/gh/theajack/cnchar@gh-pages/config.js';
jsbox.url = `${getUrl()}&config=${encodeURIComponent(config)}&id=${_id}`;
iframe.src = jsbox.url;
}
Expand Down

0 comments on commit 591cc42

Please sign in to comment.