Merge pull request #97 from huangjj27/ci-fix-deployment #109
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-CN Translation | |
on: | |
push: | |
branches: | |
- zh-CN | |
pull_request: | |
branches: | |
- zh-CN | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install mdbook | |
uses: actions-rs/[email protected] | |
with: | |
crate: mdbook | |
version: latest | |
use-tool-cache: true | |
- name: Install mdbook-linkcheck | |
uses: actions-rs/[email protected] | |
with: | |
crate: mdbook-linkcheck | |
version: latest | |
use-tool-cache: true | |
- name: Redirect with book_zh-CN.toml | |
run: rm book.toml && mv book_zh-CN.toml book.toml | |
- name: Build mdbook | |
run: mdbook build && pwd | |
- name: Cache artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
name: book | |
path: ./book | |
deploy: | |
if: github.event_name == 'push' | |
needs: build | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Deploy | |
id: deployment | |
uses: peaceiris/actions-gh-pages@v4 |