-
Notifications
You must be signed in to change notification settings - Fork 27
83 lines (67 loc) · 2.19 KB
/
Copy pathdeploy_docs.yml
File metadata and controls
83 lines (67 loc) · 2.19 KB
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
name: Deploy Site (landing + docs)
# Publishes to gh-pages:
# / -> docs/landing (the EmbodiedGen V2 project landing page)
# /docs/ -> MkDocs documentation (built from docs/documentation)
on:
push:
branches:
- master
pull_request:
branches:
- master
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install dependencies
run: |
pip install --upgrade pip
pip install mkdocs-material mkdocstrings[python] mkdocs-git-revision-date-localized-plugin
- name: Set PYTHONPATH
run: echo "PYTHONPATH=$(pwd)" >> $GITHUB_ENV
- name: Build docs (validation)
run: mkdocs build
deploy:
needs: build
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install dependencies
run: |
pip install --upgrade pip
pip install mkdocs-material mkdocstrings[python] mkdocs-git-revision-date-localized-plugin
- name: Set PYTHONPATH
run: echo "PYTHONPATH=$(pwd)" >> $GITHUB_ENV
- name: Build docs -> site/
run: mkdocs build
- name: Assemble publish dir (landing at root, docs under /docs/)
run: |
rm -rf public
mkdir -p public/docs
cp -a docs/landing/. public/
rm -rf public/tools public/README.md # build tooling / readme are not part of the published site
cp -a site/. public/docs/
- name: Configure git identity
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
- name: Publish to gh-pages
run: ghp-import -n -p -f -m "Deploy landing + docs ${GITHUB_SHA}" public