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,29 @@ 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
36
44
mv source/favicon/* source/
37
45
rm -rf source/favicon
38
46
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
47
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
48
sed -i 's,http://,https://,g' node_modules/hexo-theme-fluid/layout/_partials/footer/beian.ejs
49
+ - name : Patch for CN-Domain website
50
+ if : ${{ matrix.platform == 'cn' }}
51
+ run : |
52
+ echo "MOEICP=20241816" >> $GITHUB_ENV
53
+ echo "OSS_BUCTET=potat0-box-cn" >> $GITHUB_ENV
54
+ sed -i 's/potat0.cc/土豆.space/g' _config.yml
55
+ sed -i 's/potat0.cc/土豆.space/g' source/manifest.json
56
+ sed -i 's/potat0.cc/土豆.space/g' source/robots.txt
57
+ sed -i 's/icp_text: 浙ICP备2021017952号-1/icp_text: 浙ICP备2021017952号-2/g' _config.fluid.yml
58
+ sed -i 's/police_text: 浙公网安备33010602011812号/police_text:/g' _config.fluid.yml
59
+ sed -i 's/police_code: 33010602011812/police_code:/g' _config.fluid.yml
41
60
- name : Build
42
61
run : |
43
62
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`
63
+ 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`
64
+ 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
65
- name : Clean up
47
66
run : |
48
67
cd public
@@ -53,15 +72,17 @@ jobs:
53
72
with :
54
73
accessKeyId : ${{ secrets.ALIYUN_ACCESSKEY_ID }}
55
74
accessKeySecret : ${{ secrets.ALIYUN_ACCESSKEY_SECRET }}
56
- bucket : potat0-box
75
+ bucket : ${{ env.OSS_BUCTET }}
57
76
endpoint : oss-cn-hangzhou.aliyuncs.com
58
77
folder : public
59
78
incremental : true
60
79
skipSetting : true
61
- - name : Aliyun CDN Refresh
80
+ - name : Refresh Aliyun CDN
62
81
63
82
with :
64
83
accessKeyId : ${{ secrets.ALIYUN_ACCESSKEY_ID }}
65
84
accessKeySecret : ${{ secrets.ALIYUN_ACCESSKEY_SECRET }}
66
85
type : Directory
67
- path : https://potat0.cc/
86
+ path : |
87
+ https://potat0.cc/
88
+ https://xn--udsw05j.space/
0 commit comments