Skip to content

Commit 9ba9803

Browse files
authored
Gh pages update (#795)
2 parents 80621b7 + 1054aab commit 9ba9803

3 files changed

Lines changed: 72 additions & 66 deletions

File tree

.github/workflows/gh-pages.yml

Lines changed: 65 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -2,82 +2,83 @@ name: github pages
22

33
on:
44
push:
5-
branches:
6-
- main
7-
- docs
5+
branches: [ main, docs ]
6+
pull_request:
7+
branches: [ main, docs ]
8+
types: [opened, synchronize, reopened, ready_for_review]
89

910
jobs:
1011
deploy:
1112
runs-on: ubuntu-latest
12-
defaults:
13-
run:
14-
shell: bash -l {0}
1513

1614
steps:
17-
- uses: actions/checkout@v3
15+
# ── clone ARC repo ───────────────────────────────────────────
16+
- name: Checkout ARC
17+
uses: actions/checkout@v4
18+
with:
19+
repository: ReactionMechanismGenerator/ARC
20+
path: ARC
21+
fetch-depth: 1
1822

19-
- name: Clean Ubuntu Image
20-
uses: kfir4444/free-disk-space@main
21-
with:
22-
# This may remove tools actually needed - currently does not
23-
tool-cache: true
24-
android: true
25-
dotnet: true
26-
haskell: true
27-
large-packages: true
28-
swap-storage: true
23+
# ── pull RMG sources ────────────────────────────────────────
24+
- name: Checkout RMG‑Py
25+
uses: actions/checkout@v4
26+
with:
27+
repository: ReactionMechanismGenerator/RMG-Py
28+
path: RMG-Py
29+
ref: 55464c54d1fa61b531e865682df598d33718597d
30+
fetch-depth: 1
2931

30-
- name: Set up miniconda
31-
uses: conda-incubator/setup-miniconda@v3
32-
with:
33-
auto-update-conda: true
34-
environment-file: environment.yml
35-
activate-environment: arc_env
36-
miniconda-version: latest
37-
conda-solver: libmamba
32+
- name: Checkout RMG‑database
33+
uses: actions/checkout@v4
34+
with:
35+
repository: ReactionMechanismGenerator/RMG-database
36+
path: RMG-database
37+
fetch-depth: 1
3838

39-
# - name: Update environment
40-
# run: |
41-
# conda env update -n arc_env -f environment.yml
42-
# conda list
39+
# ── build‑only env ───────────────────────────────────────────
40+
- name: Set up micromamba (rmg_env)
41+
uses: mamba-org/setup-micromamba@v2
42+
with:
43+
environment-name: rmg_env
44+
environment-file: RMG-Py/environment.yml
45+
cache-environment: true
46+
cache-downloads: true
47+
generate-run-shell: false
4348

44-
- name: Install LaTeX
45-
run: |
46-
sudo apt update -y && sudo apt upgrade -y && sudo apt autoremove -y
47-
sudo apt install texlive-latex-base -y
48-
sudo apt-get install texlive-latex-extra -y
49-
sudo apt-get install -y dvipng
49+
- name: Build RMG‑Py in rmg_env
50+
run: micromamba run -n rmg_env make -C RMG-Py -j"$(nproc)"
5051

52+
# ── docs env (wrapper shell) ────────────────────────────────
53+
- name: Set up micromamba (arc_env)
54+
uses: mamba-org/setup-micromamba@v2
55+
with:
56+
environment-name: arc_env
57+
environment-file: ARC/environment.yml
58+
cache-environment: true
59+
cache-downloads: true
5160

52-
- name: Install codecov
53-
run: conda install --force-reinstall ld_impl_linux-64 -y && conda install -y -c conda-forge codecov
61+
# ── minimal TeX for png‑math in Sphinx ──────────────────────
62+
- name: System TeX tools
63+
run: sudo apt-get update -y && sudo apt-get -y install texlive-latex-extra dvipng
5464

55-
- name: Install dependencies
56-
run: |
57-
export PYTHONPATH=$PYTHONPATH:$(pwd)
58-
conda activate arc_env
59-
cd ..
60-
git clone https://github.com/ReactionMechanismGenerator/RMG-database
61-
git clone https://github.com/ReactionMechanismGenerator/RMG-Py
62-
cd RMG-Py
63-
export PYTHONPATH=$PYTHONPATH:$(pwd)
64-
make
65-
cd ../ARC/
66-
conda deactivate
65+
# ── add legacy ABI runtime for NumPy/PyDAS ─────────────────
66+
- name: Add legacy gfortran runtime
67+
run: micromamba install -y -n arc_env -c conda-forge libgfortran=3
68+
shell: micromamba-shell {0}
6769

68-
- name: Compile docs
69-
run: |
70-
export PYTHONPATH=$PYTHONPATH:$(pwd)
71-
conda activate arc_env
72-
cd ../RMG-Py
73-
export PYTHONPATH=$PYTHONPATH:$(pwd)
74-
cd ../ARC/docs/
75-
make html
70+
# ── build HTML docs ─────────────────────────────────────────
71+
- name: Build docs
72+
run: |
73+
export PYTHONPATH=$GITHUB_WORKSPACE/RMG-Py:$GITHUB_WORKSPACE/ARC:$PYTHONPATH
74+
export PATH=$GITHUB_WORKSPACE/ARC:$PATH
75+
make -C ARC/docs html
76+
shell: micromamba-shell {0}
7677

77-
- name: Deploy
78-
uses: peaceiris/actions-gh-pages@v3.7.3
79-
with:
80-
github_token: ${{ secrets.GITHUB_TOKEN }}
81-
publish_dir: ./docs/build/html/
82-
83-
# https://github.com/marketplace/actions/github-pages-action
78+
# ── deploy only on push ─────────────────────────────────────
79+
- name: Deploy to GitHub Pages
80+
if: github.event_name == 'push'
81+
uses: peaceiris/actions-gh-pages@v4
82+
with:
83+
github_token: ${{ secrets.GITHUB_TOKEN }}
84+
publish_dir: ./docs/build/html/

.github/workflows/update-cache.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ on:
55
- cron: '0 0 */7 * *'
66
push:
77
branches: [ main ]
8+
pull_request:
9+
branches: [ main ]
10+
types: [opened, synchronize, reopened, ready_for_review]
811

912
jobs:
1013
update_cache:
@@ -128,10 +131,12 @@ jobs:
128131

129132
# ────────── Update env & save to cache ──────────
130133
- name: Update environment
131-
run: mamba env update -n arc_env -f environment.yml
134+
run: conda env update -n arc_env -f environment.yml
132135

133136
- name: Cache ARC env
137+
if: github.event_name == 'push'
134138
uses: actions/cache@v4
135139
with:
136140
path: ${{ env.CONDA }}/envs
137141
key: conda-${{ runner.os }}-${{ runner.arch }}-0
142+

environment.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ dependencies:
1212

1313
# ——— chemistry / RMG stack ————————————————
1414
- rmg::chemprop
15-
- rmg::pydas>=1.0.2
15+
- rmg::pydas>=1.0.3
1616
- rmg::pydqed>=1.0.1
1717
- rmg::pyrdl
1818
- rmg::lpsolve55

0 commit comments

Comments
 (0)