Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 7200081

Browse files
committedFeb 22, 2024··
双站点部署
1 parent 2207d20 commit 7200081

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,31 @@ 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
44+
echo "REFRESH_URL=xn--udsw05j.space" >> $GITHUB_ENV
3645
mv source/favicon/* source/
3746
rm -rf source/favicon
3847
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
3948
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
4049
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
4162
- name: Build
4263
run: |
4364
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)
4667
- name: Clean up
4768
run: |
4869
cd public
@@ -53,15 +74,15 @@ jobs:
5374
with:
5475
accessKeyId: ${{ secrets.ALIYUN_ACCESSKEY_ID }}
5576
accessKeySecret: ${{ secrets.ALIYUN_ACCESSKEY_SECRET }}
56-
bucket: potat0-box
77+
bucket: ${{ env.OSS_BUCTET }}
5778
endpoint: oss-cn-hangzhou.aliyuncs.com
5879
folder: public
5980
incremental: true
6081
skipSetting: true
61-
- name: Aliyun CDN Refresh
82+
- name: Refresh Aliyun CDN
6283
uses: visionwx/ali-cdn-refresh@v0.1.1
6384
with:
6485
accessKeyId: ${{ secrets.ALIYUN_ACCESSKEY_ID }}
6586
accessKeySecret: ${{ secrets.ALIYUN_ACCESSKEY_SECRET }}
6687
type: Directory
67-
path: https://potat0.cc/
88+
path: https://${{ env.REFRESH_URL }}/

‎_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)
Please sign in to comment.