Add Chinese (zh-CN) localization and adjust deployment metadata and workflow. Translated README and extensive src content to Chinese, updated book.toml (language, title, description, authors, git-repository-url, and edit-url-template pointing to translate/zh-cn), and switched the GitHub Pages deploy workflow to trigger on translate/**. Prepares the repo to host and deploy the zh-CN translation and route edit links to the translation branch.
51 lines
931 B
YAML
51 lines
931 B
YAML
name: Deploy Pages
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- translate/**
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: read
|
|
pages: write
|
|
id-token: write
|
|
|
|
concurrency:
|
|
group: pages
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Install mdBook
|
|
uses: peaceiris/actions-mdbook@v2
|
|
with:
|
|
mdbook-version: latest
|
|
|
|
- name: Build book
|
|
run: mdbook build
|
|
|
|
- name: Setup Pages
|
|
uses: actions/configure-pages@v5
|
|
|
|
- name: Upload artifact
|
|
uses: actions/upload-pages-artifact@v3
|
|
with:
|
|
path: ./book
|
|
|
|
deploy:
|
|
environment:
|
|
name: github-pages
|
|
url: ${{ steps.deployment.outputs.page_url }}
|
|
runs-on: ubuntu-latest
|
|
needs: build
|
|
steps:
|
|
- name: Deploy to GitHub Pages
|
|
id: deployment
|
|
uses: actions/deploy-pages@v4
|