Add files missed in last commit. #106
This file contains hidden or 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: docs | |
on: | |
push: | |
branches: | |
- main | |
permissions: | |
contents: write | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Check out CAM-SIMA | |
uses: actions/checkout@v4 | |
with: | |
repository: ESCOMP/CAM-SIMA | |
ref: development | |
path: CAM-SIMA | |
- name: Configure Git Credentials | |
run: | | |
git config user.name github-actions[bot] | |
git config user.email 41898282+github-actions[bot]@users.noreply.github.com | |
- name: Setup Python | |
run: | | |
sudo apt update | |
sudo apt install -y python3 python3-venv python3-pip | |
echo "cache_id=$(date --utc '+%F')" >> $GITHUB_ENV | |
echo "python_version=$(python3 --version | awk '{print $2}')" >> $GITHUB_ENV | |
- name: Configure cache for pip | |
uses: actions/cache@v4 | |
with: | |
key: python-${{ env.python_version }}-pip-${{ env.cache_id }} | |
path: ~/.cache/pip | |
restore-keys: | | |
python-${{ env.python_version }}-pip- | |
- name: Setup FORD | |
run: | | |
sudo apt install -y graphviz | |
python3 -m venv venv-ford | |
source venv-ford/bin/activate | |
python3 -m pip install Jinja2 Pygments beautifulsoup4 graphviz markdown markdown-include pcpp python-markdown-math rich tomli tomli-w toposort tqdm | |
python3 -m pip install --no-deps "ford@git+https://github.com/kuanchihwang/ford.git@develop/cam-sima-ford-patches" | |
- name: Setup MkDocs | |
run: | | |
python3 -m venv venv-mkdocs | |
source venv-mkdocs/bin/activate | |
python3 -m pip install mkdocs-material mkdocs-git-revision-date-localized-plugin mkdocs-git-committers-plugin-2 | |
- name: Generate documentation by FORD | |
run: | | |
source venv-ford/bin/activate | |
cd CAM-SIMA | |
ford src/dynamics/mpas/assets/ford_config.md | |
mkdir -pv ../docs/dycore/mpas | |
cp -afv src/dynamics/mpas/assets/ford/* ../docs/dycore/mpas | |
- name: Configure cache for mkdocs-material | |
uses: actions/cache@v4 | |
with: | |
key: mkdocs-material-${{ env.cache_id }} | |
path: .cache | |
restore-keys: | | |
mkdocs-material- | |
- name: Deploy to gh-pages | |
run: | | |
source venv-mkdocs/bin/activate | |
mkdocs gh-deploy -b gh-pages --force |