Read intersphinx inventories from cantera.org #425
This file contains 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: Build and deploy | |
on: | |
push: | |
# Build when main or testing is pushed to | |
branches: | |
- main | |
- testing | |
pull_request: | |
# Build when a pull request targets main or testing | |
branches: | |
- main | |
- testing | |
env: | |
SPHINX_OUTPUT_DIR: build/html | |
RSYNC_USER: "ctdeploy" | |
RSYNC_SERVER: "cantera.org" | |
DEPLOY: ${{ github.event_name == 'push' && github.repository_owner == 'Cantera' && (endswith(github.ref, 'main') || endsWith(github.ref, 'testing')) }} | |
jobs: | |
build: | |
runs-on: ubuntu-24.04 | |
steps: | |
- uses: actions/checkout@v4 | |
name: Checkout the repository | |
with: | |
submodules: recursive | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.13 | |
- name: Install pdm | |
run: | | |
python3 -m pip install pdm | |
pdm install | |
- name: Build the site | |
run: pdm run build | |
# Create artifact containing output | |
- name: Create archive for website output | |
run: | | |
tar -czf website.tar.gz ${{ env.SPHINX_OUTPUT_DIR }} | |
- name: Store archive of website output | |
uses: actions/upload-artifact@v4 | |
with: | |
path: website.tar.gz | |
retention-days: 14 | |
# The known_hosts key is generated with `ssh-keygen -F cantera.org` from a | |
# machine that has previously logged in to cantera.org and trusts | |
# that it logged in to the right machine | |
- name: Set up SSH key and host for deploy | |
if: env.DEPLOY == 'true' | |
uses: shimataro/ssh-key-action@v2 | |
with: | |
key: ${{ secrets.CTDEPLOY_KEY }} | |
known_hosts: ${{ secrets.CTDEPLOY_KNOWN_HOSTS }} | |
- name: Upload the docs | |
if: env.DEPLOY == 'true' && endsWith(github.ref, 'main') | |
env: | |
RSYNC_DEST: "cantera" | |
run: | | |
rsync -avzP --checksum --exclude='*.map' --exclude='*.md5' \ | |
--delete --delete-excluded --filter='P /mw_headers.git' --filter='P /dev' \ | |
--filter='P /?.?' --filter='P /stable' | |
"${SPHINX_OUTPUT_DIR}/" ${RSYNC_USER}@${RSYNC_SERVER}:${RSYNC_DEST} | |
- name: Upload the docs | |
if: env.DEPLOY == 'true' && endsWith(github.ref, 'testing') | |
env: | |
RSYNC_DEST: "testing.cantera.org" | |
run: | | |
rsync -avzP --checksum --exclude='*.map' --exclude='*.md5' \ | |
--delete --delete-excluded --filter='P /mw_headers.git' --filter='P /dev' \ | |
--filter='P /?.?' --filter='P /stable' | |
"${SPHINX_OUTPUT_DIR}/" ${RSYNC_USER}@${RSYNC_SERVER}:${RSYNC_DEST} |