Skip to content

Commit fd3523c

Browse files
committed
更新 workflow
1 parent 57ce749 commit fd3523c

3 files changed

Lines changed: 68 additions & 62 deletions

File tree

.github/workflows/vuepress.yml

Lines changed: 53 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,67 @@
11
name: Build
22

3-
on: [push]
3+
on: [ push ]
4+
5+
concurrency:
6+
group: build-${{ github.ref }}
7+
cancel-in-progress: false
48

59
jobs:
610
build:
711

812
runs-on: ubuntu-latest
913

1014
steps:
11-
- name: Download Source file
12-
uses: actions/checkout@v2
13-
with:
14-
ref: source
15-
16-
- name: Prepare Node env
17-
uses: actions/setup-node@v1
18-
with:
19-
node-version: "12.x"
15+
- name: Download Source file
16+
uses: actions/checkout@v4
17+
with:
18+
ref: source
19+
fetch-depth: 0
2020

21-
- name: Set env
22-
env:
23-
ACTION_DEPLOY_KEY: ${{ secrets.ACTION_DEPLOY_KEY }}
24-
run: |
25-
mkdir -p ~/.ssh/
26-
echo "$ACTION_DEPLOY_KEY" | tr -d '\r' > ~/.ssh/id_rsa
27-
chmod 600 ~/.ssh/id_rsa
28-
ssh-keyscan github.com >> ~/.ssh/known_hosts
21+
- name: Prepare Node env
22+
uses: actions/setup-node@v4
23+
with:
24+
node-version: "20.x"
2925

30-
- name: Vuepress
31-
run: |
32-
yarn
33-
yarn run docs:build
34-
cp README.md docs/.vuepress/dist
35-
cd docs/.vuepress/dist
36-
git config --global user.name 'Fluid-dev'
37-
git config --global user.email 'a.fake.account@github.com'
38-
git init
39-
git add -A
40-
git commit -m 'Update'
41-
git push -f git@github.com:fluid-dev/hexo-fluid-docs.git master
26+
- name: Set env
27+
env:
28+
ACTION_DEPLOY_KEY: ${{ secrets.ACTION_DEPLOY_KEY }}
29+
run: |
30+
mkdir -p ~/.ssh/
31+
echo "$ACTION_DEPLOY_KEY" | tr -d '\r' > ~/.ssh/id_rsa
32+
chmod 600 ~/.ssh/id_rsa
33+
ssh-keyscan github.com >> ~/.ssh/known_hosts
4234
43-
- name: Turnstyle
44-
uses: softprops/turnstyle@v1
45-
env:
46-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
35+
- name: Vuepress
36+
run: |
37+
yarn
38+
yarn run docs:build
39+
cp README.md docs/.vuepress/dist
40+
cd docs/.vuepress/dist
41+
git config --global user.name 'Fluid-dev'
42+
git config --global user.email 'a.fake.account@github.com'
43+
git init
44+
git add -A
45+
git commit -m 'Update'
46+
git push -f git@github.com:fluid-dev/hexo-fluid-docs.git master
4747
48-
- name: Setup qshell
49-
uses: foxundermoon/setup-qshell@v5
50-
with:
51-
version: '2.12.0'
48+
- name: Setup qshell
49+
uses: foxundermoon/setup-qshell@v5
50+
with:
51+
version: '2.12.0'
5252

53-
- name: Upload to OSS
54-
env:
55-
QINIU_ACCESSKEY: ${{ secrets.QINIU_ACCESSKEY }}
56-
QINIU_SECRETKEY: ${{ secrets.QINIU_SECRETKEY }}
57-
QINIU_BUCKET: 'fluid-dev'
58-
run: |
59-
rm -rf ./docs/.vuepress/dist/.git
60-
sed -i 's/\/hexo-fluid-docs\//\/docs\//g' `grep 'hexo-fluid-docs' -rl ./docs/.vuepress/dist/*`
61-
qshell account $QINIU_ACCESSKEY $QINIU_SECRETKEY action
62-
qshell listbucket $QINIU_BUCKET -o bucket.txt
63-
awk -F '\t' '/docs\// {print $1}' bucket.txt > to_delete.txt
64-
qshell batchdelete -F'\t' --force $QINIU_BUCKET -i to_delete.txt
65-
qshell qupload2 --src-dir=./docs/.vuepress/dist --bucket=$QINIU_BUCKET --key-prefix=docs/ --overwrite
66-
echo 'https://fluid-dev.com/docs/\nhttps://hexo.fluid-dev.com/docs/' >> cdnrefresh.txt
67-
qshell cdnrefresh --dirs -i cdnrefresh.txt
53+
- name: Upload to OSS
54+
env:
55+
QINIU_ACCESSKEY: ${{ secrets.QINIU_ACCESSKEY }}
56+
QINIU_SECRETKEY: ${{ secrets.QINIU_SECRETKEY }}
57+
QINIU_BUCKET: 'fluid-dev'
58+
run: |
59+
rm -rf ./docs/.vuepress/dist/.git
60+
sed -i 's/\/hexo-fluid-docs\//\/docs\//g' `grep 'hexo-fluid-docs' -rl ./docs/.vuepress/dist/*`
61+
qshell account $QINIU_ACCESSKEY $QINIU_SECRETKEY action
62+
qshell listbucket $QINIU_BUCKET -o bucket.txt
63+
awk -F '\t' '/docs\// {print $1}' bucket.txt > to_delete.txt
64+
qshell batchdelete -F'\t' --force $QINIU_BUCKET -i to_delete.txt
65+
qshell qupload2 --src-dir=./docs/.vuepress/dist --bucket=$QINIU_BUCKET --key-prefix=docs/ --overwrite
66+
echo 'https://fluid-dev.com/docs/\nhttps://hexo.fluid-dev.com/docs/' >> cdnrefresh.txt
67+
qshell cdnrefresh --dirs -i cdnrefresh.txt

docs/.vuepress/enhanceApp.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
import Ads from 'vue-google-adsense'
21
import config from './config'
32

43
export default ({ Vue }) => {
5-
Vue.use(require('vue-script2'))
6-
Vue.use(Ads.Adsense)
7-
Vue.use(Ads.InArticleAdsense)
8-
Vue.use(Ads.InFeedAdsense)
9-
Vue.use(Ads.AutoAdsense, { adClient: config.themeConfig.ads.client, isNewAdsCode: true })
4+
if (typeof document !== 'undefined') {
5+
const Ads = require('vue-google-adsense')
6+
Vue.use(require('vue-script2'))
7+
Vue.use(Ads.Adsense)
8+
Vue.use(Ads.InArticleAdsense)
9+
Vue.use(Ads.InFeedAdsense)
10+
Vue.use(Ads.AutoAdsense, { adClient: config.themeConfig.ads.client, isNewAdsCode: true })
11+
}
1012
}

package.json

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,19 @@
1313
"docs:build": "vuepress build docs"
1414
},
1515
"devDependencies": {
16-
"moment": "2.29.1",
17-
"moment-timezone": "0.5.31",
16+
"moment": "2.29.4",
17+
"moment-timezone": "0.5.35",
1818
"vue-google-adsense": "1.10.1",
1919
"vue-script2": "2.1.0",
20-
"vuepress": "1.7.1",
20+
"vuepress": "1.9.10",
2121
"vuepress-plugin-baidu-autopush": "1.0.1",
2222
"vuepress-plugin-clean-urls": "1.1.2",
2323
"vuepress-plugin-seo": "0.1.4",
2424
"vuepress-plugin-sitemap": "2.3.1",
2525
"vuepress-plugin-smooth-scroll": "0.0.10"
26+
},
27+
"resolutions": {
28+
"vue": "2.7.16",
29+
"vue-server-renderer": "2.7.16"
2630
}
2731
}

0 commit comments

Comments
 (0)