Merge pull request #180 from CrabeDeFrance/feature-hide-login-registe… #97
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: Docs | |
on: | |
# release: | |
# types: [created] | |
push: | |
branches: | |
- master | |
jobs: | |
build_book: | |
name: Build user docs | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v2 | |
- name: Install mdbook | |
env: | |
VERSION: v0.3.7 | |
run: | | |
wget "https://github.com/rust-lang/mdBook/releases/download/${VERSION}/mdbook-${VERSION}-x86_64-unknown-linux-gnu.tar.gz" -O 'mdbook.tar.gz' | |
tar xvzf mdbook.tar.gz | |
rm mdbook.tar.gz | |
./mdbook --version | |
- name: Build book | |
run: | | |
cd docs | |
../mdbook build | |
- name: Deploy to GitHub Pages | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
export COMMIT_HASH="$(echo "${GITHUB_SHA}" | cut -c1-7)" | |
cd docs/book | |
git config --global user.email '' | |
git config --global user.name 'GitHub Actions' | |
git init | |
git remote add origin "https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}" | |
git add --all | |
git commit -m "Generated docs for ${COMMIT_HASH}" | |
git push -uf origin master:gh-pages |