Update documentation.yml #2
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: Deploy documentation | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Install Rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
override: true | |
- name: Install mdbook | |
run: cargo install mdbook | |
- name: Build documentation | |
run: cargo doc --no-deps | |
- name: Deploy to GitHub Pages | |
env: | |
GITHUB_TOKEN: ${{ secrets.GH_PAT }} | |
run: | | |
git config --global user.name 'github-actions[bot]' | |
git config --global user.email 'github-actions[bot]@users.noreply.github.com' | |
git clone --branch gh-pages https://x-access-token:${{ secrets.GH_PAT }}@github.com/${{ github.repository }}.git gh-pages | |
rsync -av --delete target/doc/ gh-pages/ | |
cd gh-pages | |
git add . | |
git commit -m "Update documentation" | |
git push origin gh-pages |