Skip to content

[ci] Migrate from nwtgck/actions-netlify@v3 to netlify-cli for better PR preview control #424

[ci] Migrate from nwtgck/actions-netlify@v3 to netlify-cli for better PR preview control

[ci] Migrate from nwtgck/actions-netlify@v3 to netlify-cli for better PR preview control #424

Workflow file for this run

name: Build Project on Google Collab (Execution)
on: [pull_request]
jobs:
execution-checks:
runs-on: "runs-on=${{ github.run_id }}/family=g4dn.2xlarge/image=ubuntu24-gpu-x64/disk=large"
container:
image: docker://us-docker.pkg.dev/colab-images/public/runtime:latest
options: --gpus all
steps:
- uses: actions/checkout@v5
with:
ref: ${{ github.event.pull_request.head.sha }}
# Install build software
- name: Install Build Software & LaTeX
shell: bash -l {0}
run: |
pip install jupyter-book==1.0.3 quantecon-book-theme==0.8.2 sphinx-tojupyter==0.3.0 sphinxext-rediraffe==0.2.7 sphinxcontrib-youtube==1.3.0 sphinx-togglebutton==0.3.2 arviz sphinx-proof sphinx-exercise sphinx-reredirects
apt-get update
apt-get install dvipng texlive texlive-latex-extra texlive-fonts-recommended cm-super
- name: Check nvidia drivers
shell: bash -l {0}
run: |
nvidia-smi
- name: Check python version
shell: bash -l {0}
run: |
python --version
- name: Display Pip Versions
shell: bash -l {0}
run: pip list
- name: Download "build" folder (cache)
uses: dawidd6/action-download-artifact@v11
with:
workflow: cache.yml
branch: main
name: build-cache
path: _build
# Build of HTML (Execution Testing)
- name: Build HTML
shell: bash -l {0}
run: |
jb build lectures --path-output ./ -n -W --keep-going
- name: Upload Execution Reports
uses: actions/upload-artifact@v4
if: failure()
with:
name: execution-reports
path: _build/html/reports
- name: Install Node.js and Netlify CLI
shell: bash -l {0}
run: |
curl -fsSL https://deb.nodesource.com/setup_18.x | bash -
apt-get install -y nodejs
npm install -g netlify-cli
- name: Preview Deploy to Netlify
shell: bash -l {0}
run: |
netlify deploy \
--dir _build/html/ \
--site ${{ secrets.NETLIFY_SITE_ID }} \
--auth ${{ secrets.NETLIFY_AUTH_TOKEN }} \
--alias collab-pr-${{ github.event.pull_request.number }} \
--context deploy-preview \
--message "Collab Preview Deploy from GitHub Actions PR #${{ github.event.pull_request.number }} (commit: ${{ github.sha }})" \
--json
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}