- redistribute assets correctly for two different renderers #35
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: Deploy GitHub Page | |
on: | |
push: | |
branches: ["main"] | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
concurrency: | |
group: "pages" | |
cancel-in-progress: false | |
jobs: | |
# Build job | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
# Lecture-related tasks | |
- name: Setup Python 3.10 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
- name: Install Jupyter | |
run: | | |
python -m pip install --upgrade pip | |
pip install jupyter | |
- name: Convert all notebooks to markdown | |
run: | | |
jupyter nbconvert --to markdown --output-dir ./temp/ ./*.ipynb | |
mv temp/Lecture2_files Lecture2_files | |
jupyter nbconvert --to html --output-dir ./jupyters/ ./*.ipynb | |
cp -r assets jupyters/assets | |
- name: Customize Lecture pages with headers | |
run: | | |
cat <(echo "---"; echo "layout: doc"; echo "title: Lecture No.1"; echo "description: (coverig tasks 1-4)"; echo "---"; echo ""; echo "**| [Main Page](./index.html) | [Lecture 1](./Lecture1.html) ([native render](./jupyters/Lecture1.html)) | [Lecture 2](./Lecture2.html) ([native render](./jupyters/Lecture2.html)) |**") ./temp/Lecture1.md > Lecture1.md | |
sed -i '/# MatSE580 Guest Lecture 1/d' Lecture1.md | |
cat Lecture1.md | |
cat <(echo "---"; echo "layout: doc"; echo "title: Lecture No.2"; echo "description: (coverig tasks 4-5)"; echo "---"; echo ""; echo "**| [Main Page](./index.html) | [Lecture 1](./Lecture1.html) ([native render](./jupyters/Lecture1.html)) | [Lecture 2](./Lecture2.html) ([native render](./jupyters/Lecture2.html)) |**") ./temp/Lecture2.md > Lecture2.md | |
sed -i '/# MatSE580 Guest Lecture 2/d' Lecture2.md | |
cat Lecture2.md | |
- name: Customize README | |
run: | | |
cp README.md temp/README.md | |
cat <(echo "**| [Main Page](./index.html) | [Lecture 1](./Lecture1.html) ([native render](./jupyters/Lecture1.html)) | [Lecture 2](./Lecture2.html) ([native render](./jupyters/Lecture2.html)) |**") ./temp/README.md > README.md | |
sed -i '/# MatSE580 Guest Lectures/d' README.md | |
cat README.md | |
# README-related tasks | |
- name: Setup Pages | |
uses: actions/configure-pages@v3 | |
- name: Build with Jekyll | |
uses: actions/jekyll-build-pages@v1 | |
with: | |
source: ./ | |
destination: ./_site | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v2 | |
# Deployment job | |
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@v2 |