Add Reading 11 #50
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 Site | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
permissions: | |
contents: write | |
jobs: | |
build: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Install deps | |
run: sudo apt-get -y update && sudo apt-get -y install python3-tornado python3-yaml python3-markdown python3-dateutil | |
- name: Build site | |
run: make clean && make build | |
- name: Deploy back to GitHub | |
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
if [ -n "$GITHUB_HEAD_REF" ]; then git checkout "$GITHUB_HEAD_REF"; fi | |
git config --local user.name "GitHub Actions" | |
git config --local user.email "<>" | |
git checkout gh-pages | |
git pull --rebase origin master | |
make clean && make build | |
git add -f docs/ | |
git commit -m 'GitHub Actions: build site' || echo 'nothing to commit' | |
git push -f origin gh-pages || echo 'nothing to push' |