-
Notifications
You must be signed in to change notification settings - Fork 0
80 lines (80 loc) · 2.42 KB
/
build-deploy.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
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@v4
- 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 install -D ${{ env.full-theme-name }}
- 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@v3
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@v4
with:
artifact_name: ${{ env.artifact-key }}