Skip to content

fix workflow file, any branch namespaced in user-docs/ will trigger g… #56

fix workflow file, any branch namespaced in user-docs/ will trigger g…

fix workflow file, any branch namespaced in user-docs/ will trigger g… #56

Workflow file for this run

name: GitHub Pages
on:
push:
branches:
- main
- 'user-docs/**'
jobs:
deploy:
runs-on: ubuntu-latest
permissions:
contents: write # To push a branch
pull-requests: write # To create a PR from that branch
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Deploy GitHub Pages
run: |
cargo build --bin slosh
export PATH="$PATH:$PWD/target/debug/"
cargo install --force mdbook
# change to documentation directory
cd doc
# mk-site.sh writes the static site to the book directory
./mk-site.slosh build
git worktree add gh-pages
git config user.name "Deploy from CI"
git config user.email ""
cd gh-pages
# Delete the ref to avoid keeping history.
git update-ref -d refs/heads/gh-pages
rm -rf *
mv ../book/* .
git add .
git commit -m "Deploy $GITHUB_SHA to gh-pages"
git push --force --set-upstream origin gh-pages