Skip to content

ci(deploy-docs): install mdbook with install-action #748

ci(deploy-docs): install mdbook with install-action

ci(deploy-docs): install mdbook with install-action #748

Workflow file for this run

name: Deploy Docs
on:
merge_group:
pull_request:
branches:
- "*"
push:
branches:
- stable
- master
# Builds all docs for both stable and master branches.
# In the gh-pages branch, we place:
# stable user-guide at /
# master user-guide at /devel
# master dev-guide at /dev-guide
jobs:
doc:
name: Documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install mdbook
uses: taiki-e/install-action@v2
with:
tool: mdbook
- name: Build user-guide (stable)
if: ${{ !contains('["pull_request", "merge_group"]', github.event_name) }}
run: |
git checkout stable
# Support both old and new directory structure during the transition
cd doc/user-guide || cd doc
mdbook build
mv book ${{ runner.temp }}
- name: Build user-guide (master)
run: |
git checkout master
cd doc/user-guide
mdbook build
mv book ${{ runner.temp }}/book/devel
- name: Build dev-guide (master)
run: |
git checkout master
cd doc/dev-guide
mdbook build
mv book ${{ runner.temp }}/book/dev-guide
- name: Deploy to GitHub
if: ${{ !contains('["pull_request", "merge_group"]', github.event_name) }}
run: |
cd ${{ runner.temp }}/book
git init
git config user.name "Deploy from CI"
git config user.email ""
git add . .nojekyll
git commit -m "Deploy $GITHUB_REF $GITHUB_SHA to gh-pages"
git remote add origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY
git push --force --set-upstream origin master:gh-pages