Build and Deploy #847
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" | |
on: | |
pull_request: | |
push: | |
schedule: | |
- cron: '0 0 * * *' | |
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
# Allow one concurrent deployment | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: "recursive" | |
- name: Setup Hugo | |
uses: peaceiris/actions-hugo@v3 | |
with: | |
hugo-version: '0.139.4' | |
extended: true | |
- name: Cache Generated Images | |
id: cache-images | |
uses: actions/cache@v4 | |
with: | |
path: resources/_gen/images | |
key: ${{ runner.os }}-${{ hashFiles('config.toml') }}-${{ hashFiles('content/**/images/*') }} | |
restore-keys: | | |
${{ runner.os }}-${{ hashFiles('config.toml') }}- | |
${{ runner.os }}- | |
- name: Openring | |
run: | | |
go run git.sr.ht/~sircmpwn/openring@latest -S feed_urls.txt \ | |
-n 5 -l 100 \ | |
< other-feeds.html.tmpl \ | |
> themes/smol/layouts/partials/webring.html | |
- name: Hugo | |
run: hugo --logLevel debug --gc --minify | |
- name: Teaching raw HTML | |
run: | | |
rm -rf public/teaching/csci400-s19 | |
rm -rf public/teaching/csci564-s21 | |
cp -r content/teaching/csci400-s19 public/teaching | |
cp -r content/teaching/csci564-s21 public/teaching | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
# Upload entire repository | |
path: public | |
- name: Deploy to GitHub Pages | |
if: github.ref == 'refs/heads/master' | |
id: deployment | |
uses: actions/deploy-pages@v4 |