Added lecture 14 materials. #148
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: Pelican site CI | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
jobs: | |
build: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: "Set up Python 3.11" | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.11" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install pelican pyyaml beautifulsoup4 ghp-import | |
git clone --depth=1 --single-branch --branch mechmotum https://github.com/mechmotum/pelican-alchemy.git | |
git clone --depth=1 https://github.com/getpelican/pelican-plugins.git | |
- name: Build the website | |
run: | | |
pelican -D -v --fatal errors -s publishconf.py -o output | |
git fetch origin --tags | |
git checkout 2022Q3Q4 | |
sed -i 's|me41055|me41055/2022|' publishconf.py | |
pelican -D -v --fatal errors -s publishconf.py -o output/2022 | |
sed -i 's|blob/master|tree/2022Q3Q4|' output/2022/schedule.html | |
git checkout -- publishconf.py | |
git checkout 2023Q3Q4 | |
sed -i 's|me41055|me41055/2023|' publishconf.py | |
pelican -D -v --fatal errors -s publishconf.py -o output/2023 | |
sed -i 's|blob/master|tree/2023Q3Q4|' output/2023/schedule.html | |
ls output/ | |
- name: Deploy the website | |
if: ${{ github.event_name == 'push' }} | |
run: | | |
git config --global user.name "Github Actions" | |
git config --global user.email [email protected] | |
git remote add deploy "https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/moorepants/me41055.git" | |
ghp-import --no-history -r deploy -b gh-pages -m "Updated via Github Actions" -p output |