Skip to content

Workflow file for this run

# this workflow builds the cv,
# uploads it to the GitHub release that triggered the job
# and uploads built files to the publish branch, where they are served by GitHub pages
name: build cv and publish to GitHub release and github pages site
on:
push:
tags:
- "*"
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: oven-sh/setup-bun@v1
- name: Install dependencies
run: bun install
- name: Test
run: bun run test
- name: Build html
run: bun run build-html
- name: Build pdf
run: bun run build-pdf
- name: Save build folder as artifact
uses: actions/upload-artifact@v3
with:
name: build
path: build
- name: Save pdf as artifact
uses: actions/upload-artifact@v2
with:
name: cv.pdf
path: build/cv.pdf
publish-to-release:
needs: build
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Download artifact
uses: actions/download-artifact@v3
with:
name: build
path: build
- name: Zip build files
run: zip -r build.zip build
- name: Upload build to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: build.zip
asset_name: build.zip
tag: ${{ github.ref }}
overwrite: true
- name: Upload pdf to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: build/cv.pdf
asset_name: cv.pdf
tag: ${{ github.ref }}
overwrite: true
publish-to-gh-pages-branch:
needs: build
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout main branch
uses: actions/checkout@v3
with:
ref: main
- name: Download artifact
uses: actions/download-artifact@v3
with:
name: build
path: build
- name: Remove old files from /docs
run: rm -rf docs/*
- name: Copy build files to /docs
run: cp -r build/* docs/
- name: Copy static files to /docs
run: cp -r public/* docs/
- name: Rename cv.html to index.html
run: mv docs/cv.html docs/index.html
- name: Rename cv.pdf to Alfie-Renn-CV.pdf
run: mv docs/cv.pdf docs/Alfie-Renn-CV.pdf
- name: Git auto commit
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: "Update cv to ${{ github.ref_name }}"