Merge branch 'main' into system-stats-tab #65
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: Render User Manual | |
on: | |
push: | |
paths: | |
- manual/** | |
permissions: | |
contents: write | |
jobs: | |
build: | |
# The CMake configure and build commands are platform agnostic and should work equally | |
# well on Windows or Mac. You can convert this to a matrix build if you need | |
# cross-platform coverage. | |
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install packages | |
shell: bash | |
run: | | |
sudo apt-get update | |
sudo apt-get install texlive texlive-latex-extra texlive-fonts-extra texlive-lang-english lmodern texlive-latex-recommended pandoc | |
# Note: this is adapted from https://github.com/LibreSolar/md-manual-template/blob/master/.travis.yml | |
- name: Generate manual | |
shell: bash | |
run: | | |
pandoc -v | |
cd manual | |
make dist | |
- name: Push to github.io | |
shell: bash | |
if: github.ref_name == 'main' | |
run: | | |
export git_hash=$(git describe --always HEAD) | |
git clone -b gh-pages https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY website | |
cd website | |
git rm -rf * && rm -rf * | |
cd .. | |
mv manual/build/* website | |
cd website | |
git config --local user.email "$(git log --format='%ae' HEAD^!)" | |
git config --local user.name "$(git log --format='%an' HEAD^!)" | |
git add * | |
git commit -am "Generated user manual from Git commit ${git_hash}" | |
git push |