make it work on fork #6
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 website | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
# Adds keys to work with other repositories used in this lesson (e.g., UCL/github-example) | |
# - uses: webfactory/[email protected] | |
# with: | |
# ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} | |
- uses: actions/cache@v4 # FIXME: add apt(latex) | |
with: | |
path: vendor/bundle | |
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile') }} | |
restore-keys: | | |
${{ runner.os }}-gems- | |
- uses: actions/cache@v4 | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt', '.github/python/requirements.txt') }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
- name: Install TeXLive | |
uses: DanySK/[email protected] | |
- id: setup-python | |
name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.12 | |
- name: Install dependencies | |
run: python -m pip install -r .github/python/requirements.txt | |
- name: Building notes | |
run: make ready | |
- uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: '3.3' | |
- name: Install bundler and dependencies | |
run: | | |
gem install bundler | |
bundle install | |
- name: Build website | |
run: bundle exec jekyll build | |
- name: Build the JupyterLite site | |
run: | | |
rm -rf `find . -type d -name .pytest_cache` | |
rm -rf `find . -type d -name .ruff_cache` | |
rm -rf `find . -type d -name .doctrees` | |
mkdir content | |
mkdir _site/jupyter-lite | |
cp -R ch*/*.ipynb content | |
jupyter lite build --contents content --output-dir _site/jupyter-lite | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: _site | |
deploy: | |
# if: > | |
# github.ref == 'refs/heads/main' | |
# && github.repository == 'UCL/rsd-engineeringcourse' | |
needs: build | |
permissions: | |
pages: write | |
id-token: write | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 |