trpl-zh-cn/.github/workflows/main.yml

45 lines
1.1 KiB
YAML
Raw Normal View History

2021-07-07 11:09:42 +08:00
name: CI
on:
# Trigger the workflow on push or pull request,
# but only for the main branch
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@main
- name: Update rustup
run: rustup self update
- name: Install Rust
run: |
rustup set profile minimal
2022-02-06 16:46:31 +08:00
rustup toolchain install 1.58 -c rust-docs
rustup default 1.58
2021-07-07 11:09:42 +08:00
- name: Install mdbook
run: |
mkdir bin
2022-02-06 16:46:31 +08:00
curl -sSL https://github.com/rust-lang/mdBook/releases/download/v0.4.14/mdbook-v0.4.14-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=bin
2021-07-07 11:09:42 +08:00
echo "$(pwd)/bin" >> ${GITHUB_PATH}
- name: Report versions
run: |
rustup --version
rustc -Vv
mdbook --version
- name: Run mdBook Build
run: mdbook build
- name: Deploy gh-pages
if: ${{ github.ref == 'refs/heads/main' }}
2021-07-07 11:09:42 +08:00
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./book
force_orphan: true
2022-02-06 16:46:31 +08:00
enable_jekyll: true