gravitymon/.github/workflows/doc-build.yaml
Magnus Persson b277274eab Testing
2022-01-08 16:31:38 +01:00

46 lines
1.3 KiB
YAML

name: Sphinx Build
on:
push:
branches:
- dev
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ammaraskar/sphinx-action@master
with:
docs-folder: "src_docs/"
pre-build-command: "pip install sphinx_rtd_theme"
build-command: "sphinx-build -b html ./source ../docs"
# .nojekyll file must exist in docs
- name: Commit documentation changes
run: |
pwd
ls -al
ls -al docs
git clone https://github.com/mp-se/gravitymon.git --branch ghpages --single-branch ghpages
mkdir -p ghpages/docs
cp -r docs/* ghpages/docs
cd ghpages
touch docs/.nojekyll
git config --local user.email "action@noreply.github.com"
git config --local user.name "GitHub Action"
git add .
git commit -m "Update documentation" -a || true
git push https://${{ secrets.GITHUB_TOKEN }}@github.com/mp-se/gravitymon.git
# The above command will fail if no changes were present, so we ignore
# the return code.
# - name: Push changes
# uses: ad-m/github-push-action@master
# with:
# branch: ghpages
# directory: docs
# github_token: ${{ secrets.GITHUB_TOKEN }}