Skip to content

Commit 74ad188

Browse files
committed
更新 workflow
1 parent 57ce749 commit 74ad188

5 files changed

Lines changed: 9203 additions & 64 deletions

File tree

.github/workflows/vuepress.yml

Lines changed: 54 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,68 @@
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"
25+
cache: 'yarn'
2926

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

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

.gitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
.idea/
22
*.log
33
*.iml
4-
yarn.lock
5-
package-lock.json
64

75
# Created by https://www.gitignore.io/api/vuejs
86
# Edit at https://www.gitignore.io/?templates=vuejs

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)