Skip to content

Commit 29152f9

Browse files
committed
[CI] Update CI for Sphinx-built site
1 parent cd6fc33 commit 29152f9

File tree

1 file changed

+19
-61
lines changed

1 file changed

+19
-61
lines changed

.github/workflows/main.yaml

Lines changed: 19 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -13,83 +13,39 @@ on:
1313
- testing
1414

1515
env:
16-
NIKOLA_OUTPUT_DIR: output
17-
WEBSITE_CLONE_DIR: website
16+
SPHINX_OUTPUT_DIR: build/html
1817
RSYNC_USER: "ctdeploy"
1918
RSYNC_SERVER: "cantera.org"
2019
DEPLOY: ${{ github.event_name == 'push' && github.repository_owner == 'Cantera' && (endswith(github.ref, 'main') || endsWith(github.ref, 'testing')) }}
2120

2221
jobs:
2322
build:
24-
runs-on: ubuntu-20.04
23+
runs-on: ubuntu-24.04
2524
steps:
26-
- uses: actions/checkout@v2
25+
- uses: actions/checkout@v4
2726
name: Checkout the repository
2827
with:
2928
submodules: recursive
30-
path: ${{ env.WEBSITE_CLONE_DIR }}
31-
- uses: actions/checkout@v2
32-
name: Checkout Cantera repository
33-
with:
34-
submodules: recursive
35-
repository: Cantera/cantera
36-
path: cantera
37-
ref: 2.6
38-
- uses: actions/checkout@v2
39-
name: Checkout Cantera 'main' repository
40-
with:
41-
submodules: recursive
42-
repository: Cantera/cantera
43-
path: cantera-dev
44-
- uses: actions/checkout@v2
45-
name: Checkout Cantera Jupyter repository
46-
with:
47-
repository: Cantera/cantera-jupyter
48-
path: cantera-jupyter
4929
- name: Setup Python
50-
uses: actions/setup-python@v2
30+
uses: actions/setup-python@v5
5131
with:
52-
python-version: 3.9
53-
architecture: x64
54-
- name: Upgrade pip
55-
run: python3 -m pip install -U pip setuptools wheel
56-
- name: Get pip cache dir
57-
id: pip-cache
58-
run: echo "::set-output name=dir::$(python3 -m pip cache dir)"
59-
60-
- name: Cache dependencies
61-
uses: actions/cache@v2
62-
with:
63-
path: ${{ steps.pip-cache.outputs.dir }}
64-
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
65-
restore-keys: ${{ runner.os }}-pip-
66-
67-
- name: Install dependencies
68-
run: python3 -m pip install -r requirements.txt
69-
working-directory: ${{ env.WEBSITE_CLONE_DIR }}
70-
71-
# Parse SCons configuration for development version and move reST file
72-
- name: Parse configuration options from Cantera SConstruct as reST
32+
python-version: 3.13
33+
- name: Install pdm
7334
run: |
74-
cd cantera-dev
75-
python3 `which scons` help --restructured-text --dev --output=scons-config-options-dev.rst
76-
cd ..
77-
mv -f cantera-dev/scons-config-options-dev.rst ${{ env.WEBSITE_CLONE_DIR }}/pages/compiling/
78-
35+
python3 -m pip install pdm
36+
pdm install
7937
- name: Build the site
80-
run: NIKOLA_DEBUG=1 nikola build
81-
working-directory: ${{ env.WEBSITE_CLONE_DIR }}
38+
run: pdm run build
8239

8340
# Create artifact containing output
8441
- name: Create archive for website output
8542
run: |
86-
cd ${{ env.WEBSITE_CLONE_DIR }}; \
87-
tar -czf website.tar.gz ${{ env.NIKOLA_OUTPUT_DIR }}
43+
tar -czf website.tar.gz ${{ env.SPHINX_OUTPUT_DIR }}
8844
- name: Store archive of website output
89-
uses: actions/upload-artifact@v2
45+
uses: actions/upload-artifact@v4
9046
with:
91-
path: ${{ env.WEBSITE_CLONE_DIR }}/website.tar.gz
92-
retention-days: 5
47+
path: website.tar.gz
48+
retention-days: 14
9349

9450
# The known_hosts key is generated with `ssh-keygen -F cantera.org` from a
9551
# machine that has previously logged in to cantera.org and trusts
@@ -106,13 +62,15 @@ jobs:
10662
RSYNC_DEST: "cantera"
10763
run: |
10864
rsync -avzP --checksum --exclude='*.map' --exclude='*.md5' \
109-
--delete --delete-excluded --filter='P /mw_headers.git' --filter='P /documentation/dev/*' \
110-
"${WEBSITE_CLONE_DIR}/${NIKOLA_OUTPUT_DIR}/" ${RSYNC_USER}@${RSYNC_SERVER}:${RSYNC_DEST}
65+
--delete --delete-excluded --filter='P /mw_headers.git' --filter='P /dev' \
66+
--filter='P /?.?' --filter='P /stable'
67+
"${SPHINX_OUTPUT_DIR}/" ${RSYNC_USER}@${RSYNC_SERVER}:${RSYNC_DEST}
11168
- name: Upload the docs
11269
if: env.DEPLOY == 'true' && endsWith(github.ref, 'testing')
11370
env:
11471
RSYNC_DEST: "testing.cantera.org"
11572
run: |
11673
rsync -avzP --checksum --exclude='*.map' --exclude='*.md5' \
117-
--delete --delete-excluded --filter='P /mw_headers.git' --filter='P /documentation/dev/*' \
118-
"${WEBSITE_CLONE_DIR}/${NIKOLA_OUTPUT_DIR}/" ${RSYNC_USER}@${RSYNC_SERVER}:${RSYNC_DEST}
74+
--delete --delete-excluded --filter='P /mw_headers.git' --filter='P /dev' \
75+
--filter='P /?.?' --filter='P /stable'
76+
"${SPHINX_OUTPUT_DIR}/" ${RSYNC_USER}@${RSYNC_SERVER}:${RSYNC_DEST}

0 commit comments

Comments
 (0)