Skip to content

Commit 2421ef9

Browse files
authored
Add GitHub Actions workflow for deployment to GitHub Pages (#3)
1 parent 65a0fe5 commit 2421ef9

1 file changed

Lines changed: 67 additions & 0 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
---
2+
name: Deploy
3+
4+
on:
5+
merge_group:
6+
types: [checks_requested]
7+
push:
8+
branches: [main]
9+
workflow_dispatch:
10+
11+
permissions:
12+
contents: read
13+
14+
jobs:
15+
Build:
16+
runs-on: ubuntu-24.04
17+
18+
steps:
19+
- name: Checkout repository
20+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
21+
with:
22+
persist-credentials: false
23+
24+
- name: Setup Bun
25+
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
26+
27+
- name: Cache dependencies
28+
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
29+
with:
30+
path: ~/.bun/install/cache
31+
key: bun-${{ runner.os }}-${{ hashFiles('bun.lock') }}
32+
restore-keys: bun-${{ runner.os }}-
33+
34+
- name: Install dependencies
35+
run: bun install --frozen-lockfile
36+
37+
- name: Build project
38+
run: bun run build
39+
40+
- name: Upload to GitHub Pages
41+
if: github.event_name != 'merge_group'
42+
uses: actions/upload-pages-artifact@7b1f4a764d45c48632c6b24a0339c27f5614fb0b # v4.0.0
43+
with:
44+
path: dist
45+
retention-days: 1
46+
47+
Deploy:
48+
if: github.event_name != 'merge_group'
49+
needs: Build
50+
runs-on: ubuntu-24.04
51+
52+
permissions:
53+
id-token: write
54+
pages: write
55+
56+
concurrency:
57+
cancel-in-progress: true
58+
group: github-pages
59+
60+
environment:
61+
name: github-pages
62+
url: ${{ steps.deployment.outputs.page_url }}
63+
64+
steps:
65+
- name: Deploy to GitHub Pages
66+
id: deployment
67+
uses: actions/deploy-pages@cd2ce8fcbc39b97be8ca5fce6e763baed58fa128 # v5.0.0

0 commit comments

Comments
 (0)