Update README.md #168
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: Documentation | |
on: [push] | |
jobs: | |
documentation: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write # To push a branch | |
pages: write # To push to a GitHub Pages site | |
id-token: write # To update the deployment status | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Check modified files need re run | |
id: filter | |
uses: dorny/paths-filter@v2 | |
with: | |
filters: | | |
docs: | |
- 'docs/**' | |
docs2: | |
- 'book.toml' | |
workflow: | |
- '.github/workflows/documentation.yml' | |
- name: Install latest mdbook | |
if: steps.filter.outputs.docs == 'true' || steps.filter.outputs.docs2 == 'true' || steps.filter.outputs.workflow == 'true' || github.ref == 'refs/heads/main' | |
run: | | |
tag=$(curl 'https://api.github.com/repos/rust-lang/mdbook/releases/latest' | jq -r '.tag_name') | |
url="https://github.com/rust-lang/mdbook/releases/download/${tag}/mdbook-${tag}-x86_64-unknown-linux-gnu.tar.gz" | |
mkdir mdbook | |
curl -sSL $url | tar -xz --directory=./mdbook | |
echo `pwd`/mdbook >> $GITHUB_PATH | |
- name: Install emojify | |
if: steps.filter.outputs.docs == 'true' || steps.filter.outputs.docs2 == 'true' || steps.filter.outputs.workflow == 'true' || github.ref == 'refs/heads/main' | |
run: | | |
wget --no-verbose https://github.com/shonfeder/emojitsu/releases/download/0.1.1/gh-actions-emojitsu | |
chmod +x gh-actions-emojitsu | |
# Emojify the markdown | |
find . -type f -name "*.md" -exec ./gh-actions-emojitsu emojify -i {} \; | |
- name: Build Book | |
if: steps.filter.outputs.docs == 'true' || steps.filter.outputs.docs2 == 'true' || steps.filter.outputs.workflow == 'true' || github.ref == 'refs/heads/main' | |
run: mdbook build | |
- name: Copy OnlineRunner | |
if: steps.filter.outputs.docs == 'true' || steps.filter.outputs.docs2 == 'true' || steps.filter.outputs.workflow == 'true' || github.ref == 'refs/heads/main' | |
run: cp ./lvtext/webrunner/index.html ./book/OnlineVM.html | |
- name: Setup Pages | |
if: github.ref == 'refs/heads/main' | |
uses: actions/configure-pages@v3 | |
- name: Upload artifact | |
if: steps.filter.outputs.docs == 'true' || steps.filter.outputs.docs2 == 'true' || steps.filter.outputs.workflow == 'true' || github.ref == 'refs/heads/main' | |
uses: actions/upload-pages-artifact@v2 | |
with: | |
# Upload entire repository | |
path: 'book' | |
- name: Deploy to GitHub Pages | |
if: github.ref == 'refs/heads/main' | |
id: deployment | |
uses: actions/deploy-pages@v2 |