-
Notifications
You must be signed in to change notification settings - Fork 1
118 lines (102 loc) · 3.17 KB
/
pages.yml
File metadata and controls
118 lines (102 loc) · 3.17 KB
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
name: Deploy Website to GitHub Pages
on:
workflow_run:
workflows: ["CI", "Regenerate Demos"]
types: [completed]
branches: [main]
push:
tags: ['v*']
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: pages
cancel-in-progress: false
jobs:
build:
runs-on: ubuntu-latest
if: >-
github.event_name == 'workflow_dispatch' ||
startsWith(github.ref, 'refs/tags/v') ||
(github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success')
env:
HUGO_VERSION: "0.159.2"
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install Hugo
run: |
wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb
sudo dpkg -i ${{ runner.temp }}/hugo.deb
- name: Install Go
uses: actions/setup-go@v5
with:
go-version-file: 'cli/go.mod'
- name: Set up Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Setup Pages
id: pages
uses: actions/configure-pages@v5
- name: Inject version
if: startsWith(github.ref, 'refs/tags/v')
run: |
VERSION="${GITHUB_REF_NAME#v}"
mkdir -p website/data
echo "version: \"$VERSION\"" > website/data/release.yaml
echo "tag: \"$GITHUB_REF_NAME\"" >> website/data/release.yaml
- name: Build with Hugo
working-directory: website
env:
HUGO_CACHEDIR: ${{ runner.temp }}/hugo_cache
HUGO_ENVIRONMENT: production
TZ: America/New_York
run: |
hugo \
--gc \
--minify \
--baseURL "${{ steps.pages.outputs.base_url }}/"
- name: Install website test dependencies
working-directory: website
run: bun install --frozen-lockfile
- name: Build local test site
working-directory: website
env:
HUGO_CACHEDIR: ${{ runner.temp }}/hugo_cache_test
HUGO_ENVIRONMENT: production
TZ: America/New_York
run: |
hugo \
--gc \
--minify \
--destination public-test \
--baseURL "http://127.0.0.1:1313/"
- name: Install Playwright browsers
working-directory: website
run: bunx playwright install --with-deps chromium
- name: Run website Playwright checks
working-directory: website
env:
PLAYWRIGHT_BASE_URL: http://127.0.0.1:1313
PLAYWRIGHT_WEB_SERVER_COMMAND: python3 -m http.server 1313 --directory public-test
PLAYWRIGHT_WEB_SERVER_PORT: '1313'
run: bun run test:e2e
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: website/public
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4