mirror of https://github.com/sunface/rust-course
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
47 lines
973 B
47 lines
973 B
name: Deploy
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
|
|
defaults:
|
|
run:
|
|
shell: bash
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
deploy:
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
matrix:
|
|
os: [ubuntu-latest, macos-latest, windows-latest]
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Install Rust
|
|
run: |
|
|
rustup set profile minimal
|
|
rustup toolchain install stable
|
|
rustup default stable
|
|
- name: Setup mdBook
|
|
uses: peaceiris/actions-mdbook@v2
|
|
with:
|
|
mdbook-version: "latest"
|
|
- run: mdbook build
|
|
- name: Copy Assets
|
|
run: |
|
|
chmod +x ci/copy-assets.sh
|
|
ci/copy-assets.sh ${{ matrix.os }}
|
|
- name: Deploy
|
|
uses: peaceiris/actions-gh-pages@v3
|
|
if: ${{ github.ref == 'refs/heads/main' }}
|
|
with:
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
publish_dir: ./book
|