-
Notifications
You must be signed in to change notification settings - Fork 1
Set up GitHub Pages publishing #11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
a446346
Set up GitHub Pages publishing (cache + publish workflows, environment)
mmcky 31db88e
Deploy Pages via the native artifact flow instead of a gh-pages branch
mmcky ea253ba
Simplify publish.yml: HTML only, via quantecon/actions/publish-gh-pages
mmcky fc22b5b
Add Netlify PR previews (ci.yml) for reviewer-facing rendered builds
mmcky 2d5a4e7
Address Copilot review: drop dangling nb_repository_url, clear doctrees
mmcky File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| name: Build Cache [using jupyter-book] | ||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| jobs: | ||
| cache: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
| - name: Setup Anaconda | ||
| uses: conda-incubator/setup-miniconda@v4 | ||
| with: | ||
| auto-update-conda: true | ||
| auto-activate-base: true | ||
| miniconda-version: 'latest' | ||
| python-version: "3.13" | ||
| environment-file: environment.yml | ||
| activate-environment: quantecon | ||
| - name: Build HTML | ||
| shell: bash -l {0} | ||
| run: | | ||
| jb build lectures --path-output ./ --keep-going | ||
| # TODO: Re-enable -W flag once all lectures are translated and warnings are resolved | ||
| - name: Upload Execution Reports | ||
| uses: actions/upload-artifact@v7 | ||
| if: failure() | ||
| with: | ||
| name: execution-reports | ||
| path: _build/html/reports | ||
| - name: Upload "_build" folder (cache) | ||
| uses: actions/upload-artifact@v7 | ||
| with: | ||
| name: build-cache | ||
| path: _build | ||
| include-hidden-files: true |
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,137 @@ | ||
| name: Build & Publish to GH Pages | ||
| on: | ||
| push: | ||
| tags: | ||
| - 'publish*' | ||
| jobs: | ||
| publish: | ||
| if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v6 | ||
| with: | ||
| fetch-depth: 0 | ||
| - name: Setup Anaconda | ||
| uses: conda-incubator/setup-miniconda@v4 | ||
| with: | ||
| auto-update-conda: true | ||
| auto-activate-base: true | ||
| miniconda-version: 'latest' | ||
| python-version: "3.13" | ||
| environment-file: environment.yml | ||
| activate-environment: quantecon | ||
| - name: Install latex dependencies | ||
| run: | | ||
| sudo apt-get -qq update | ||
| sudo apt-get install -y \ | ||
| texlive-latex-recommended \ | ||
| texlive-latex-extra \ | ||
| texlive-fonts-recommended \ | ||
| texlive-fonts-extra \ | ||
| texlive-xetex \ | ||
| latexmk \ | ||
| xindy \ | ||
| dvipng \ | ||
| cm-super | ||
| - name: Display Conda Environment Versions | ||
| shell: bash -l {0} | ||
| run: conda list | ||
| - name: Display Pip Versions | ||
| shell: bash -l {0} | ||
| run: pip list | ||
| # Download Build Cache from cache.yml | ||
| - name: Download "build" folder (cache) | ||
| uses: dawidd6/action-download-artifact@v21 | ||
| with: | ||
| workflow: cache.yml | ||
| branch: main | ||
| name: build-cache | ||
| path: _build | ||
|
mmcky marked this conversation as resolved.
|
||
| # TODO: pdf support | ||
| # # Build Assets (Download Notebooks, PDF via LaTeX) | ||
| # - name: Build PDF from LaTeX | ||
| # shell: bash -l {0} | ||
| # run: | | ||
| # jb build lectures --builder pdflatex --path-output ./ -n -W --keep-going | ||
| # - name: Copy LaTeX PDF for GH-PAGES | ||
| # shell: bash -l {0} | ||
| # run: | | ||
| # mkdir -p _build/html/_pdf | ||
| # cp -u _build/latex/*.pdf _build/html/_pdf | ||
| # TODO: download notebook support | ||
| # - name: Build Download Notebooks (sphinx-tojupyter) | ||
| # shell: bash -l {0} | ||
| # run: | | ||
| # jb build lectures --path-output ./ --builder=custom --custom-builder=jupyter -n -W --keep-going | ||
| # zip -r download-notebooks.zip _build/jupyter | ||
| # - uses: actions/upload-artifact@v4 | ||
| # with: | ||
| # name: download-notebooks | ||
| # path: download-notebooks.zip | ||
| # - name: Copy Download Notebooks for GH-PAGES | ||
| # shell: bash -l {0} | ||
| # run: | | ||
| # mkdir -p _build/html/_notebooks | ||
| # cp -u _build/jupyter/*.ipynb _build/html/_notebooks | ||
| # Final Build of HTML (with assets) | ||
| - name: Build HTML | ||
| shell: bash -l {0} | ||
| run: | | ||
| jb build lectures --path-output ./ -n --keep-going | ||
| # TODO: Re-enable -W flag once all lectures are translated and warnings are resolved | ||
| # Create HTML archive for release assets | ||
| - name: Create HTML archive | ||
| shell: bash -l {0} | ||
| run: | | ||
| tar -czf lecture-python-programming-fr-html-${{ github.ref_name }}.tar.gz -C _build/html . | ||
| sha256sum lecture-python-programming-fr-html-${{ github.ref_name }}.tar.gz > html-checksum.txt | ||
|
|
||
| # Create metadata manifest | ||
| cat > html-manifest.json << EOF | ||
| { | ||
| "tag": "${{ github.ref_name }}", | ||
| "commit": "${{ github.sha }}", | ||
| "timestamp": "$(date -Iseconds)", | ||
| "size_mb": $(du -sm _build/html | cut -f1), | ||
| "file_count": $(find _build/html -type f | wc -l) | ||
| } | ||
| EOF | ||
| - name: Upload archives to release | ||
| uses: softprops/action-gh-release@v3 | ||
| with: | ||
| files: | | ||
| lecture-python-programming-fr-html-${{ github.ref_name }}.tar.gz | ||
| html-checksum.txt | ||
| html-manifest.json | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| - name: Deploy website to gh-pages | ||
| uses: peaceiris/actions-gh-pages@v4 | ||
| with: | ||
| github_token: ${{ secrets.GITHUB_TOKEN }} | ||
| publish_dir: _build/html/ | ||
| # cname: python-programming-fr.quantecon.org # enable together with the _config.yml baseurl flip once DNS is decided | ||
| # TODO: download notebook support | ||
| # - name: Prepare lecture-python-programming.notebooks sync | ||
| # shell: bash -l {0} | ||
| # run: | | ||
| # mkdir -p _build/lecture-python-programming.notebooks | ||
| # cp -a _notebook_repo/. _build/lecture-python-programming.notebooks | ||
| # cp _build/jupyter/*.ipynb _build/lecture-python-programming.notebooks | ||
| # ls -a _build/lecture-python-programming.notebooks | ||
| # - name: Commit notebooks to lecture-python-programming.notebooks | ||
| # shell: bash -l {0} | ||
| # env: | ||
| # QE_SERVICES_PAT: ${{ secrets.QUANTECON_SERVICES_PAT }} | ||
| # run: | | ||
| # git clone https://quantecon-services:$QE_SERVICES_PAT@github.com/quantecon/lecture-python-programming.notebooks | ||
|
|
||
| # cp _build/lecture-python-programming.notebooks/*.ipynb lecture-python-programming.notebooks | ||
|
|
||
| # cd lecture-python-programming.notebooks | ||
| # git config user.name "QuantEcon Services" | ||
| # git config user.email "admin@quantecon.org" | ||
| # git add *.ipynb | ||
| # git commit -m "auto publishing updates to notebooks" | ||
| # git push origin main | ||
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| name: quantecon | ||
| channels: | ||
| - default | ||
| dependencies: | ||
| - python=3.13 | ||
| - anaconda=2026.06 | ||
| - pip | ||
| - pip: | ||
| - jupyter-book>=1.0.4post1,<2.0 | ||
| - quantecon-book-theme==0.21.0 | ||
| - sphinx-tojupyter==0.6.0 | ||
| - sphinxext-rediraffe==0.3.0 | ||
| - sphinx-exercise==1.2.1 | ||
| - sphinxcontrib-youtube==1.5.0 | ||
| - sphinx-togglebutton==0.4.5 | ||
|
|
||
|
|
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.