2020 shell : bash -l {0}
2121 timeout-minutes : 20
2222 steps :
23- - uses : actions/checkout@v4
23+ - uses : actions/checkout@v5
2424 with :
2525 persist-credentials : false
2626 fetch-depth : 0
@@ -37,52 +37,60 @@ jobs:
3737
3838 - if : ${{ steps.skip_check.outputs.should_skip != 'true' }}
3939 name : Set up Conda Environment
40- uses : conda-incubator /setup-miniconda@v3
40+ uses : mamba-org /setup-micromamba@v2
4141 with :
42- activate-environment : " mpas_analysis_ci"
43- miniforge-version : latest
44- channels : conda-forge
45- channel-priority : strict
46- auto-update-conda : false
47- python-version : ${{ env.PYTHON_VERSION }}
42+ environment-name : mpas_analysis_dev
43+ init-shell : bash
44+ condarc : |
45+ channel_priority: strict
46+ channels:
47+ - conda-forge
48+ create-args : >-
49+ python=${{ env.PYTHON_VERSION }}
4850
4951 - if : ${{ steps.skip_check.outputs.should_skip != 'true' }}
5052 name : Install mpas_analysis
5153 run : |
5254 git config --global url."https://github.com/".insteadOf "[email protected] :" 53- conda create -n mpas_analysis_dev --file dev-spec.txt \
55+ conda install -y --file dev-spec.txt \
5456 python=${{ env.PYTHON_VERSION }}
55- conda activate mpas_analysis_dev
5657 python -m pip install -vv --no-deps --no-build-isolation -e .
5758
5859 - name : Build Sphinx Docs
5960 run : |
6061 set -e
61- conda activate mpas_analysis_dev
6262 pip check
6363 mpas_analysis sync diags --help
6464 cd docs
65- sphinx-multiversion . _build/ html
65+ DOCS_VERSION=${{ github.ref_name }} make versioned- html
6666 - name : Copy Docs and Commit
6767 run : |
6868 set -e
69- conda activate mpas_analysis_dev
7069 pip check
7170 mpas_analysis sync diags --help
7271 cd docs
7372 # gh-pages branch must already exist
7473 git clone https://github.com/MPAS-Dev/MPAS-Analysis.git --branch gh-pages --single-branch gh-pages
74+
75+ # Only replace docs in a directory with the destination branch name with latest changes. Docs for
76+ # releases should be untouched.
77+ rm -rf gh-pages/${{ github.ref_name }}
78+
79+ # don't clobber existing release versions (in case we retroactively fixed them)
80+ cp -r _build/html/${{ github.ref_name }} gh-pages/
81+
82+ mkdir -p gh-pages/shared
83+ cp shared/version-switcher.js gh-pages/shared/version-switcher.js
84+
85+ # Update the list of versions with all versions in the gh-pages directory.
86+ python generate_versions_json.py
87+
7588 # Make sure we're in the gh-pages directory.
7689 cd gh-pages
7790 # Create `.nojekyll` (if it doesn't already exist) for proper GH Pages configuration.
7891 touch .nojekyll
7992 # Add `index.html` to point to the `develop` branch automatically.
8093 printf '<meta http-equiv="refresh" content="0; url=./develop/index.html" />' > index.html
81- # Only replace docs in a directory with the destination branch name with latest changes. Docs for
82- # releases should be untouched.
83- rm -rf ${{ github.head_ref || github.ref_name }}
84- # don't clobber existing release versions (in case we retroactively fixed them)
85- cp -r -n ../_build/html/* .
8694 # Configure git using GitHub Actions credentials.
8795 git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
8896 git config --local user.name "github-actions[bot]"
0 commit comments