Merge remote-tracking branch 'origin/main' into dev #1055
Workflow file for this run
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: | |
deploy: | |
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' | |
- name: Install latest mdbook | |
if: steps.filter.outputs.docs == 'true' || steps.filter.outputs.docs2 == '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' || 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' || github.ref == 'refs/heads/main' | |
run: mdbook build | |
- name: Setup Pages | |
if: github.ref == 'refs/heads/main' | |
uses: actions/configure-pages@v3 | |
- name: Upload artifact | |
if: 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 |