Bump actions/deploy-pages from 2 to 3 #160
Workflow file for this run
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 Github Pages | |
on: | |
# Runs on pushes targeting the default branch | |
push: | |
pull_request: | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
inputs: | |
deploy_trigger: | |
description: Force a deployment to pages | |
default: "false" | |
required: true | |
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.11"] | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
- name: Set up Python 🐍 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: 'pip' | |
cache-dependency-path: '**/requirements.txt' | |
- name: Install dependencies 💁🏻 | |
run: | | |
python -m pip install --upgrade pip wheel setuptools | |
python -m pip install --upgrade -r requirements.txt | |
- name: Build slides 📚 | |
run: | | |
shopt -s globstar | |
jupytext --to ipynb ${{ github.workspace }}/**/*.py.md | |
jupyter nbconvert --execute --allow-errors --to html ${{ github.workspace }}/**/*.py.ipynb | |
# jupyter nbconvert --to slides ${{ github.workspace }}/slides/**/*-slides.py.ipynb | |
- name: Setup Ruby 💎 | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: '3.0' # Not needed with a .ruby-version file | |
rubygems: latest | |
bundler-cache: true # runs 'bundle install' and caches installed gems automatically | |
cache-version: 0 # Increment this number if you need to re-download cached gems | |
- name: Setup Pages | |
id: pages | |
uses: actions/[email protected] | |
- name: Build with Jekyll 🔨 | |
run: bundle exec jekyll build --baseurl ${{ steps.pages.outputs.base_path }} # defaults output to '/_site' | |
- name: Upload artifact ⬆️ | |
uses: actions/upload-pages-artifact@v2 # This will automatically upload an artifact from the '/_site' directory | |
# Deployment job | |
deploy: | |
if: > | |
(github.event_name == 'push' && github.event.ref == 'refs/heads/main') || | |
(github.event_name == 'workflow_dispatch' && github.event.inputs.deploy_trigger == | |
'true') | |
concurrency: | |
group: "pages" | |
cancel-in-progress: true | |
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@v3 | |
# prebuild-binder: | |
# runs-on: ubuntu-latest | |
# steps: | |
# - name: Checkout Code | |
# uses: actions/checkout@v2 | |
# - name: update jupyter dependencies with repo2docker | |
# uses: jupyterhub/repo2docker-action@master | |
# with: | |
# NO_PUSH: true | |
# MYBINDERORG_TAG: ${{ github.event.ref }} |