Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
107 changes: 54 additions & 53 deletions .github/workflows/vuepress.yml
Original file line number Diff line number Diff line change
@@ -1,67 +1,68 @@
name: Build

on: [push]
on: [ push ]

concurrency:
group: build-${{ github.ref }}
cancel-in-progress: false

jobs:
build:

runs-on: ubuntu-latest

steps:
- name: Download Source file
uses: actions/checkout@v2
with:
ref: source

- name: Prepare Node env
uses: actions/setup-node@v1
with:
node-version: "12.x"
- name: Download Source file
uses: actions/checkout@v4
with:
ref: source
fetch-depth: 0

- name: Set env
env:
ACTION_DEPLOY_KEY: ${{ secrets.ACTION_DEPLOY_KEY }}
run: |
mkdir -p ~/.ssh/
echo "$ACTION_DEPLOY_KEY" | tr -d '\r' > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh-keyscan github.com >> ~/.ssh/known_hosts
- name: Prepare Node env
uses: actions/setup-node@v4
with:
node-version: "20.x"
cache: 'yarn'

- name: Vuepress
run: |
yarn
yarn run docs:build
cp README.md docs/.vuepress/dist
cd docs/.vuepress/dist
git config --global user.name 'Fluid-dev'
git config --global user.email 'a.fake.account@github.com'
git init
git add -A
git commit -m 'Update'
git push -f git@github.com:fluid-dev/hexo-fluid-docs.git master
- name: Set env
env:
ACTION_DEPLOY_KEY: ${{ secrets.ACTION_DEPLOY_KEY }}
run: |
mkdir -p ~/.ssh/
echo "$ACTION_DEPLOY_KEY" | tr -d '\r' > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh-keyscan github.com >> ~/.ssh/known_hosts

- name: Turnstyle
uses: softprops/turnstyle@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Vuepress
run: |
yarn
yarn run docs:build
cp README.md docs/.vuepress/dist
cd docs/.vuepress/dist
git config --global user.name 'Fluid-dev'
git config --global user.email 'a.fake.account@github.com'
git init
git add -A
git commit -m 'Update'
git push -f git@github.com:fluid-dev/hexo-fluid-docs.git master

- name: Setup qshell
uses: foxundermoon/setup-qshell@v5
with:
version: '2.12.0'
- name: Setup qshell
uses: foxundermoon/setup-qshell@v5
with:
version: '2.12.0'

- name: Upload to OSS
env:
QINIU_ACCESSKEY: ${{ secrets.QINIU_ACCESSKEY }}
QINIU_SECRETKEY: ${{ secrets.QINIU_SECRETKEY }}
QINIU_BUCKET: 'fluid-dev'
run: |
rm -rf ./docs/.vuepress/dist/.git
sed -i 's/\/hexo-fluid-docs\//\/docs\//g' `grep 'hexo-fluid-docs' -rl ./docs/.vuepress/dist/*`
qshell account $QINIU_ACCESSKEY $QINIU_SECRETKEY action
qshell listbucket $QINIU_BUCKET -o bucket.txt
awk -F '\t' '/docs\// {print $1}' bucket.txt > to_delete.txt
qshell batchdelete -F'\t' --force $QINIU_BUCKET -i to_delete.txt
qshell qupload2 --src-dir=./docs/.vuepress/dist --bucket=$QINIU_BUCKET --key-prefix=docs/ --overwrite
echo 'https://fluid-dev.com/docs/\nhttps://hexo.fluid-dev.com/docs/' >> cdnrefresh.txt
qshell cdnrefresh --dirs -i cdnrefresh.txt
- name: Upload to OSS
env:
QINIU_ACCESSKEY: ${{ secrets.QINIU_ACCESSKEY }}
QINIU_SECRETKEY: ${{ secrets.QINIU_SECRETKEY }}
QINIU_BUCKET: 'fluid-dev'
run: |
rm -rf ./docs/.vuepress/dist/.git
sed -i 's/\/hexo-fluid-docs\//\/docs\//g' `grep 'hexo-fluid-docs' -rl ./docs/.vuepress/dist/*`
qshell account $QINIU_ACCESSKEY $QINIU_SECRETKEY action
qshell listbucket $QINIU_BUCKET -o bucket.txt
awk -F '\t' '/docs\// {print $1}' bucket.txt > to_delete.txt
qshell batchdelete -F'\t' --force $QINIU_BUCKET -i to_delete.txt
qshell qupload2 --src-dir=./docs/.vuepress/dist --bucket=$QINIU_BUCKET --key-prefix=docs/ --overwrite
echo 'https://fluid-dev.com/docs/\nhttps://hexo.fluid-dev.com/docs/' >> cdnrefresh.txt
qshell cdnrefresh --dirs -i cdnrefresh.txt
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
.idea/
*.log
*.iml
yarn.lock
package-lock.json

# Created by https://www.gitignore.io/api/vuejs
# Edit at https://www.gitignore.io/?templates=vuejs
Expand Down
14 changes: 8 additions & 6 deletions docs/.vuepress/enhanceApp.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import Ads from 'vue-google-adsense'
import config from './config'

export default ({ Vue }) => {
Vue.use(require('vue-script2'))
Vue.use(Ads.Adsense)
Vue.use(Ads.InArticleAdsense)
Vue.use(Ads.InFeedAdsense)
Vue.use(Ads.AutoAdsense, { adClient: config.themeConfig.ads.client, isNewAdsCode: true })
if (typeof document !== 'undefined') {
const Ads = require('vue-google-adsense')
Vue.use(require('vue-script2'))
Vue.use(Ads.Adsense)
Vue.use(Ads.InArticleAdsense)
Vue.use(Ads.InFeedAdsense)
Vue.use(Ads.AutoAdsense, { adClient: config.themeConfig.ads.client, isNewAdsCode: true })
}
}
10 changes: 7 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,19 @@
"docs:build": "vuepress build docs"
},
"devDependencies": {
"moment": "2.29.1",
"moment-timezone": "0.5.31",
"moment": "2.29.4",
"moment-timezone": "0.5.35",
"vue-google-adsense": "1.10.1",
"vue-script2": "2.1.0",
"vuepress": "1.7.1",
"vuepress": "1.9.10",
"vuepress-plugin-baidu-autopush": "1.0.1",
"vuepress-plugin-clean-urls": "1.1.2",
"vuepress-plugin-seo": "0.1.4",
"vuepress-plugin-sitemap": "2.3.1",
"vuepress-plugin-smooth-scroll": "0.0.10"
},
"resolutions": {
"vue": "2.7.16",
"vue-server-renderer": "2.7.16"
}
}
Loading
Loading