Skip to content

Merge pull request #5 from PennLINC/new_harmonization #3

Merge pull request #5 from PennLINC/new_harmonization

Merge pull request #5 from PennLINC/new_harmonization #3

name: Deploy Reproducibility Guide
on:
push:
branches:
- main
paths:
- "reproducibility_guide/**"
- ".github/workflows/deploy_reproducibility_guide.yml"
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install Jupyter Book
run: |
python -m pip install --upgrade pip
# Pin classic Jupyter Book; newer mystmd-based CLI has different behavior.
python -m pip install "jupyter-book==0.15.1"
- name: Build book
run: jb build reproducibility_guide
- name: Locate built HTML
id: locate_book
run: |
if [ -d reproducibility_guide/_build/html ]; then
echo "path=reproducibility_guide/_build/html" >> "$GITHUB_OUTPUT"
elif [ -d _build/html ]; then
echo "path=_build/html" >> "$GITHUB_OUTPUT"
else
echo "Could not find built HTML directory."
echo "Checked: reproducibility_guide/_build/html and _build/html"
exit 1
fi
- name: Show selected artifact path
run: |
echo "Using Pages artifact path: ${{ steps.locate_book.outputs.path }}"
ls -la "${{ steps.locate_book.outputs.path }}"
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: ${{ steps.locate_book.outputs.path }}
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4