12
12
permissions :
13
13
contents : read
14
14
deployments : write
15
+ strategy :
16
+ fail-fast : false
17
+ matrix :
18
+ platform :
19
+ - main
20
+ - cn
15
21
steps :
16
22
- name : Set up Node.js
17
23
uses : actions/setup-node@main
@@ -33,16 +39,31 @@ jobs:
33
39
npm install
34
40
- name : Get and Patch Lib Files
35
41
run : |
42
+ echo "MOEICP=20221816" >> $GITHUB_ENV
43
+ echo "OSS_BUCTET=potat0-box" >> $GITHUB_ENV
44
+ echo "REFRESH_URL=xn--udsw05j.space" >> $GITHUB_ENV
36
45
mv source/favicon/* source/
37
46
rm -rf source/favicon
38
47
curl https://cdn.jsdelivr.net/gh/PrismJS/prism-themes@master/themes/prism-material-light.min.css --create-dirs -o node_modules/prismjs/themes/prism-materiallight.css
39
48
curl https://cdn.jsdelivr.net/gh/PrismJS/prism-themes@master/themes/prism-material-oceanic.min.css --create-dirs -o node_modules/prismjs/themes/prism-materialoceanic.css
40
49
sed -i 's,http://,https://,g' node_modules/hexo-theme-fluid/layout/_partials/footer/beian.ejs
50
+ - name : Patch for CN-Domain website
51
+ if : ${{ matrix.platform == 'cn' }}
52
+ run : |
53
+ echo "MOEICP=20241816" >> $GITHUB_ENV
54
+ echo "OSS_BUCTET=potat0-box-cn" >> $GITHUB_ENV
55
+ echo "REFRESH_URL=potat0.cc" >> $GITHUB_ENV
56
+ sed -i 's/potat0.cc/土豆.space/g' _config.yml
57
+ sed -i 's/potat0.cc/土豆.space/g' source/manifest.json
58
+ sed -i 's/potat0.cc/土豆.space/g' source/robots.txt
59
+ sed -i 's/icp_text: 浙ICP备2021017952号-1/icp_text: 浙ICP备2021017952号-2/g' _config.fluid.yml
60
+ sed -i 's/police_text: 浙公网安备33010602011812号/police_text:/g' _config.fluid.yml
61
+ sed -i 's/police_code: 33010602011812/police_code:/g' _config.fluid.yml
41
62
- name : Build
42
63
run : |
43
64
hexo g
44
- sed -i 's` IEJUMPIEJUMPIEJUMP` if(/*@cc_on!@*/false||(!!window.MSInputMethodContext\&\&!!document.documentMode))window.location.href="https://support.dmeng.net/upgrade-your-browser.html?referrer="+encodeURIComponent(window.location.href);` g' ` grep IEJUMPIEJUMPIEJUMP -rl ./public`
45
- sed -i 's` <div class="beian"><span>` <div class="beian"><span><a href="https://icp.gov.moe/?keyword=20221816 "target="_blank"rel="nofollow">萌ICP备20221816号 </a></span><span style="margin-bottom:.25rem">`g' ` grep '<div class="beian">' -rl ./public`
65
+ sed -i 's, IEJUMPIEJUMPIEJUMP, if(/*@cc_on!@*/false||(!!window.MSInputMethodContext\&\&!!document.documentMode))window.location.href="https://support.dmeng.net/upgrade-your-browser.html?referrer="+encodeURIComponent(window.location.href);, g' $( grep IEJUMPIEJUMPIEJUMP -rl ./public)
66
+ sed -i "s, <div class=\ "beian\ "><span>, <div class=\ "beian\ "><span><a href=\ "https://icp.gov.moe/?keyword=$MOEICP\ "target=\ "_blank\ "rel=\ "nofollow\">萌ICP备$MOEICP号 </a></span><span style=\ "margin-bottom:.25rem\">,g" $( grep '<div class=\ "beian\ ">' -rl ./public)
46
67
- name : Clean up
47
68
run : |
48
69
cd public
@@ -53,15 +74,15 @@ jobs:
53
74
with :
54
75
accessKeyId : ${{ secrets.ALIYUN_ACCESSKEY_ID }}
55
76
accessKeySecret : ${{ secrets.ALIYUN_ACCESSKEY_SECRET }}
56
- bucket : potat0-box
77
+ bucket : ${{ env.OSS_BUCTET }}
57
78
endpoint : oss-cn-hangzhou.aliyuncs.com
58
79
folder : public
59
80
incremental : true
60
81
skipSetting : true
61
- - name : Aliyun CDN Refresh
82
+ - name : Refresh Aliyun CDN
62
83
uses : visionwx/ali-cdn-refresh@v0.1.1
63
84
with :
64
85
accessKeyId : ${{ secrets.ALIYUN_ACCESSKEY_ID }}
65
86
accessKeySecret : ${{ secrets.ALIYUN_ACCESSKEY_SECRET }}
66
87
type : Directory
67
- path : https://potat0.cc /
88
+ path : https://${{ env.REFRESH_URL }} /
0 commit comments