Skip to content

Commit 6142ce0

Browse files
authored
Merge pull request #9 from kuanchihwang/staging/mpas-dycore-docs
Generate and link to MPAS dynamical core documentation
2 parents 03f02db + d763471 commit 6142ce0

File tree

2 files changed

+47
-12
lines changed

2 files changed

+47
-12
lines changed

.github/workflows/docs-deploy.yml

Lines changed: 45 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,56 @@ jobs:
1515
with:
1616
fetch-depth: 0
1717

18+
- name: Check out CAM-SIMA
19+
uses: actions/checkout@v4
20+
with:
21+
repository: ESCOMP/CAM-SIMA
22+
ref: development
23+
path: CAM-SIMA
24+
1825
- name: Configure Git Credentials
1926
run: |
2027
git config user.name github-actions[bot]
2128
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
2229
2330
- name: Setup Python
2431
run: |
25-
sudo apt update
26-
sudo apt install -y python3 python3-venv python3-pip
27-
python3 -m venv myenv
28-
source myenv/bin/activate
29-
pip install mkdocs-material mkdocs-git-revision-date-localized-plugin mkdocs-git-committers-plugin-2
30-
echo "cache_id=$(date --utc '+%F')" >> $GITHUB_ENV
31-
32-
- name: Configure cache
32+
sudo apt update
33+
sudo apt install -y python3 python3-venv python3-pip
34+
echo "cache_id=$(date --utc '+%F')" >> $GITHUB_ENV
35+
echo "python_version=$(python3 --version | awk '{print $2}')" >> $GITHUB_ENV
36+
37+
- name: Configure cache for pip
38+
uses: actions/cache@v4
39+
with:
40+
key: python-${{ env.python_version }}-pip-${{ env.cache_id }}
41+
path: ~/.cache/pip
42+
restore-keys: |
43+
python-${{ env.python_version }}-pip-
44+
45+
- name: Setup FORD
46+
run: |
47+
sudo apt install -y graphviz
48+
python3 -m venv venv-ford
49+
source venv-ford/bin/activate
50+
python3 -m pip install Jinja2 Pygments beautifulsoup4 graphviz markdown markdown-include pcpp python-markdown-math rich tomli tomli-w toposort tqdm
51+
python3 -m pip install --no-deps "ford@git+https://github.com/kuanchihwang/ford.git@develop/cam-sima-ford-patches"
52+
53+
- name: Setup MkDocs
54+
run: |
55+
python3 -m venv venv-mkdocs
56+
source venv-mkdocs/bin/activate
57+
python3 -m pip install mkdocs-material mkdocs-git-revision-date-localized-plugin mkdocs-git-committers-plugin-2
58+
59+
- name: Generate documentation by FORD
60+
run: |
61+
source venv-ford/bin/activate
62+
cd CAM-SIMA
63+
ford src/dynamics/mpas/assets/ford-config.md
64+
mkdir -pv ../docs/dycore/mpas
65+
cp -afv src/dynamics/mpas/assets/ford/* ../docs/dycore/mpas
66+
67+
- name: Configure cache for mkdocs-material
3368
uses: actions/cache@v4
3469
with:
3570
key: mkdocs-material-${{ env.cache_id }}
@@ -39,6 +74,5 @@ jobs:
3974
4075
- name: Deploy to gh-pages
4176
run: |
42-
source myenv/bin/activate
43-
mkdocs gh-deploy -b gh-pages --force
44-
77+
source venv-mkdocs/bin/activate
78+
mkdocs gh-deploy -b gh-pages --force

mkdocs.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ nav:
4141
- atmospheric_physics/directory-structure.md
4242
- atmospheric_physics/development_workflow.md
4343
- atmospheric_physics/Tagging-Instructions.md
44+
- Dynamical Core:
45+
- MPAS: dycore/mpas
4446

4547
plugins:
4648
- search
@@ -70,7 +72,6 @@ theme:
7072
- media: "(prefers-color-scheme: light)"
7173
scheme: default
7274

73-
7475
toggle:
7576
icon: material/brightness-7
7677
name: Switch to dark mode

0 commit comments

Comments
 (0)