This repository has been archived by the owner on Oct 10, 2024. It is now read-only.
Update Rust crate comrak to 0.23.0 #890
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: Publish documentation to GitHub Pages | |
on: [push] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
name: "Publish documentation" | |
steps: | |
- name: Setup Rust toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: nightly | |
target: x86_64-unknown-linux-gnu | |
default: true | |
profile: default | |
- name: Checkout codebase | |
uses: actions/checkout@v4 | |
with: | |
path: ./dokkoo | |
- name: Checkout GitHub Pages environment | |
uses: actions/checkout@v4 | |
with: | |
ref: gh-pages | |
path: ./gh-pages | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Generate documentation | |
run: | | |
sudo apt-get -qq install tree > /dev/null | |
printf "Codebase:\n" && tree ./dokkoo | |
find ./gh-pages -mindepth 1 ! -regex '^./gh-pages/.git\(/.*\)?' -delete | |
cd ./dokkoo | |
printf "\nGenerating documentation … " | |
time cargo doc --no-deps --document-private-items --release --quiet | |
cd ../ | |
cp -ar ./dokkoo/target/doc/* ./gh-pages | |
touch ./gh-pages/.nojekyll | |
tee -a ./gh-pages/.nojekyll > /dev/null <<EOT | |
EOT | |
printf "\nDocumentation:\n" && tree ./gh-pages | |
- name: Publish | |
run: | | |
cd ./gh-pages | |
git config --global user.name 'Dokkoo' | |
git config --global user.email '[email protected]' | |
git add -A | |
git diff --quiet && git diff --staged --quiet || git commit -am "Publish documentation to GitHub Pages" | |
git push |