Skip to content

Commit 8ef4984

Browse files
committed
双站点部署
1 parent 2207d20 commit 8ef4984

File tree

2 files changed

+27
-6
lines changed

2 files changed

+27
-6
lines changed

.github/workflows/main.yml

+26-5
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@ jobs:
1212
permissions:
1313
contents: read
1414
deployments: write
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
platform:
19+
- main
20+
- cn
1521
steps:
1622
- name: Set up Node.js
1723
uses: actions/setup-node@main
@@ -33,16 +39,29 @@ jobs:
3339
npm install
3440
- name: Get and Patch Lib Files
3541
run: |
42+
echo "MOEICP=20221816" >> $GITHUB_ENV
43+
echo "OSS_BUCTET=potat0-box" >> $GITHUB_ENV
3644
mv source/favicon/* source/
3745
rm -rf source/favicon
3846
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
3947
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
4048
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
4160
- name: Build
4261
run: |
4362
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`
4665
- name: Clean up
4766
run: |
4867
cd public
@@ -53,15 +72,17 @@ jobs:
5372
with:
5473
accessKeyId: ${{ secrets.ALIYUN_ACCESSKEY_ID }}
5574
accessKeySecret: ${{ secrets.ALIYUN_ACCESSKEY_SECRET }}
56-
bucket: potat0-box
75+
bucket: ${{ env.OSS_BUCTET }}
5776
endpoint: oss-cn-hangzhou.aliyuncs.com
5877
folder: public
5978
incremental: true
6079
skipSetting: true
61-
- name: Aliyun CDN Refresh
80+
- name: Refresh Aliyun CDN
6281
uses: visionwx/[email protected]
6382
with:
6483
accessKeyId: ${{ secrets.ALIYUN_ACCESSKEY_ID }}
6584
accessKeySecret: ${{ secrets.ALIYUN_ACCESSKEY_SECRET }}
6685
type: Directory
67-
path: https://potat0.cc/
86+
path: |
87+
https://potat0.cc/
88+
https://xn--udsw05j.space/

_config.fluid.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@ footer:
451451
# ICP证号
452452
icp_text: 浙ICP备2021017952号-1
453453
# 公安备案号,不填则只显示ICP
454-
police_text: "浙公网安备 33010602011812号"
454+
police_text: 浙公网安备33010602011812号
455455
# 公安备案的编号,用于URL跳转查询
456456
police_code: 33010602011812
457457
# 公安备案的图片. 为空时不显示备案图片

0 commit comments

Comments
 (0)