-
Notifications
You must be signed in to change notification settings - Fork 0
102 lines (82 loc) · 2.58 KB
/
Copy pathdeploy.yml
File metadata and controls
102 lines (82 loc) · 2.58 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
name: Deploy
on:
push:
branches: [main]
workflow_dispatch:
permissions:
contents: read
concurrency:
group: pages
cancel-in-progress: true
jobs:
check:
name: Typecheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: pnpm/action-setup@v4
with:
version: 10
- uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm
- run: pnpm install --frozen-lockfile
# Types only; this does not need the wasm artifact.
- run: pnpm check
build:
name: Build
runs-on: ubuntu-latest
permissions:
contents: read
# Required to drop stale Nix store caches after a new one is written.
actions: write
steps:
- uses: actions/checkout@v5
- uses: cachix/install-nix-action@v31
with:
extra_nix_config: |
experimental-features = nix-command flakes
# Persist /nix across runs so a warm job substitutes ghostty-vt-wasm
# instead of paying for the Zig compile. Keyed on flake inputs and the
# pnpm lock (what the derivations hash); site source changes reuse the
# restored store and only rebuild the site.
- uses: nix-community/cache-nix-action@v7
with:
primary-key: nix-${{ runner.os }}-${{ hashFiles('flake.nix', 'flake.lock', 'pnpm-lock.yaml') }}
restore-prefixes-first-match: nix-${{ runner.os }}-
purge: true
purge-prefixes: nix-${{ runner.os }}-
purge-created: 0
purge-primary-key: never
# Builds libghostty-vt for wasm32-freestanding from the pinned ghostty
# revision, then the site around it.
- run: nix build .#default
# `result` is a symlink into the read-only nix store; the Pages artifact
# action needs a real, writable directory.
- name: Materialise build output
run: |
mkdir -p dist
cp -rL result/. dist/
chmod -R u+w dist
- name: Verify the wasm shipped
run: test -s dist/ghostty-vt.wasm
- uses: actions/configure-pages@v5
- uses: actions/upload-pages-artifact@v3
with:
path: dist
deploy:
name: Deploy to Pages
needs: [check, build]
# Manual runs can select another ref; never deploy one of those by accident.
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- id: deployment
uses: actions/deploy-pages@v4