move resume generation to ci pipeline #27
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 blog | |
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. | |
concurrency: | |
group: "pages" | |
cancel-in-progress: true | |
on: | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
# Runs on pushes targeting the default branch | |
push: | |
branches: [master] | |
env: | |
ghc_version: '9.8.1' | |
jobs: | |
build: | |
name: build and deploy page | |
runs-on: ubuntu-latest | |
# Deploy to the github-pages environment | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.9' | |
cache: 'pip' # caching pip dependencies | |
- name: install Pygments | |
run: pip install -r requirements.txt | |
- name: set up GHC ${{ env.ghc_version }} | |
uses: haskell-actions/setup@v2 | |
id: setup | |
with: | |
ghc-version: ${{ env.ghc_version }} | |
- name: configure build | |
run: | | |
cabal configure --disable-tests --disable-benchmarks -f '+ci' | |
cabal build all --dry-run | |
- name: restore cached dependencies | |
uses: actions/cache/restore@v4 | |
id: cache | |
env: | |
key: ${{ runner.os }}-ghc-${{ steps.setup.outputs.ghc-version }}-cabal-${{ steps.setup.outputs.cabal-version }} | |
with: | |
path: ${{ steps.setup.outputs.cabal-store }} | |
key: ${{ env.key }}-plan-${{ hashFiles('**/plan.json') }} | |
restore-keys: ${{ env.key }}- | |
- name: install dependencies | |
# If we had an exact cache hit, the dependencies will be up to date. | |
if: steps.cache.outputs.cache-hit != 'true' | |
run: cabal build all --only-dependencies | |
# Cache dependencies already here, so that we do not have to rebuild them should the subsequent steps fail. | |
- name: save cached dependencies | |
uses: actions/cache/save@v4 | |
# If we had an exact cache hit, trying to save the cache would error because of key clash. | |
if: steps.cache.outputs.cache-hit != 'true' | |
with: | |
path: ${{ steps.setup.outputs.cabal-store }} | |
key: ${{ steps.cache.outputs.cache-primary-key }} | |
- name: build blog | |
run: | | |
cabal build all | |
cabal exec -- blog build -v Info | |
- name: build resume | |
uses: xu-cheng/latex-action@v3 | |
with: | |
args: -r resume/latexmkrc -outdir=_site/static -auxdir=.shake/ | |
root_file: resume/resume.tex | |
- name: setup pages | |
uses: actions/configure-pages@v4 | |
- name: upload artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: '_site/' | |
- name: deploy to github pages | |
id: deployment | |
uses: actions/deploy-pages@v4 |