【更新】在线翻译 #187
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: zh-Hans-CN_CI | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- '**' | |
- '!gh-pages' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write # To push a branch | |
pull-requests: write # To create a PR from that branch | |
steps: | |
# Check | |
- uses: actions/checkout@v4 | |
with: | |
ref: zh-Hans-CN | |
submodules: recursive | |
- name: Setup mdBook | |
uses: peaceiris/actions-mdbook@v1 | |
with: | |
mdbook-version: '0.4.37' | |
# mdbook-version: 'latest' | |
- run: mdbook -V && mdbook build && mdbook test | |
- run: | | |
echo '创建 tree/:' | |
mkdir /home/runner/tree | |
echo '复制 ./book/ 到 /home/runner/tree/zh-Hans-CN:' | |
ls ./book/ | |
cp -v -u -r ./book/ /home/runner/tree/zh-Hans-CN | |
echo '检查 tree/zh-Hans-CN:' | |
ls /home/runner/tree/zh-Hans-CN | |
# HTML/CSS/JS Minifier | |
# - run: cd /home/runner/tree/zh-Hans-CN | |
# - uses: docker://devatherock/minify-js:2.0.0 | |
# with: | |
# add_suffix: false # Optional | |
# Run merge zh-Hans-CN and gh-pages | |
- uses: actions/checkout@v3 | |
with: | |
ref: gh-pages | |
- run: | | |
# echo '如果存在则删除 ./zh-Hans-CN:' | |
# if [ -d "./zh-Hans-CN/" ];then | |
rm -r ./zh-Hans-CN/ | |
# else | |
# echo "文件夹不存在。" | |
# fi; | |
echo '复制 /home/runner/tree/zh-Hans-CN/ 到 ./zh-Hans-CN/:' | |
cp -v -u -r /home/runner/tree/zh-Hans-CN/ ./zh-Hans-CN/ | |
ls ./zh-Hans-CN/ | |
- name: Generate the sitemap | |
id: sitemap | |
uses: cicirello/generate-sitemap@v1 | |
with: | |
base-url-path: https://hamud.pj568.sbs/ | |
# Deploy | |
- uses: JamesIves/github-pages-deploy-action@v4 | |
with: | |
branch: gh-pages # The branch the action should deploy to. | |
folder: . # The folder the action should deploy. | |
- name: Ping Google | |
run: curl https://www.google.com/ping?sitemap=https://hamud.pj568.sbs/sitemap.xml |