Skip to content

Build and Deploy

Build and Deploy #32

Workflow file for this run

name: "Build and Deploy"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
on:
workflow_dispatch:
inputs:
theme:
type: string
description: "Theme to use for building website and/or PDF document (jsonresume-theme-<theme>)"
required: true
default: macchiato-plus
deploy:
type: boolean
description: "Whether to deploy or not"
required: true
default: false
node-version:
type: string
description: "NodeJS version to use"
required: false
default: "lts/*"
bun-version:
type: string
description: "Bun version to use"
required: false
default: "latest"
chrome-version:
type: string
description: "Chrome version to use"
required: false
default: "stable"
env:
artifact-key: deployment-${{ github.sha }}
deployment-directory: dist
full-theme-name: jsonresume-theme-${{ inputs.theme }}
content-package-path: packages/cv-content
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Setup tooling
id: setup-tooling
uses: ./.github/actions/setup-tooling
with:
node-version: ${{ inputs.node-version }}
bun-version: ${{ inputs.bun-version }}
use-chrome: "true"
chrome-version: ${{ inputs.chrome-version }}
- name: Install selected theme
working-directory: ${{ env.content-package-path }}
run: bun add ${{ env.full-theme-name }} -d -E
- name: Build website
env:
THEME: ${{ env.full-theme-name }}
PUPPETEER_BROWSER_REVISION: ${{ steps.setup-tooling.outputs.chrome-version }}
PUPPETEER_EXECUTABLE_PATH: ${{ steps.setup-tooling.outputs.chrome-path }}
run: bun run build
- name: Create deployable artifact
uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3.0.1
with:
name: ${{ env.artifact-key }}
path: ${{ env.deployment-directory }}
deploy:
needs: build
if: ${{ inputs.deploy }}
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4.0.5
with:
artifact_name: ${{ env.artifact-key }}