-
Notifications
You must be signed in to change notification settings - Fork 123
47 lines (43 loc) · 1.52 KB
/
doc-build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
name: Build FarmVibes.AI documentation
run-name: Generate documentation html pages
on:
pull_request:
types: [closed]
branches:
- main
workflow_dispatch:
jobs:
if_merged:
if: github.event.pull_request.merged == true || contains(fromJSON('["workflow_dispatch"]'), github.event_name)
name: Build documentation
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Update pip version
shell: bash
run: pip install --upgrade pip
### Build docs with sphinx
- name: Build documentation pages
uses: ammaraskar/sphinx-action@master
with:
docs-folder: "docs/"
pre-build-command: "pip install --user ./src/vibe_core"
# Publish built docs to gh-pages branch
- name: Publish to gh-pages
run: |
git clone https://github.com/microsoft/farmvibes-ai.git --branch gh-pages --single-branch gh-pages
cp -r docs/build/html/* gh-pages/
cd gh-pages
touch .nojekyll
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add .
git commit -m "Update documentation" -a || true
# The above command will fail if no changes were present, so we ignore that.
- name: Push changes
uses: ad-m/github-push-action@master
with:
branch: gh-pages
directory: gh-pages
github_token: ${{ secrets.GITHUB_TOKEN }}