You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is the general outline of a shell script that will build the book, add its contents to the gh-pages branch, and push that branch. This may need editing based on your needs (such as if the book is located in a subdirectory, etc.).
# Installs mdbook
mkdir mdbook
# Consider using a service like renovatebot if you want to automatically update the version here.
curl -Lf https://github.com/rust-lang/mdBook/releases/download/v0.4.37/mdbook-v0.4.37-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=./mdbook
echo`pwd`/mdbook >>$GITHUB_PATH# Build the book
mdbook build
# If the gh-pages branch already exists, this will overwrite it# so that the history is not kept, which can be very expensive.
git worktree add --orphan -B gh-pages gh-pages
cp -r book/ gh-pages
git config user.name "Deploy from CI"
git config user.email ""cd gh-pages
git add -A
git commit -m 'deploy new book'
git push origin +gh-pages
cd ..