-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (56 loc) · 1.92 KB
/
deploy.yml
File metadata and controls
65 lines (56 loc) · 1.92 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
name: Update changelog & deploy
on:
# Trigger when CMS monorepo pushes a new tag
repository_dispatch:
types: [cms-release]
# Manual trigger
workflow_dispatch:
# Auto on push to main (content changes)
push:
branches: [main]
paths:
- 'content/**'
- 'src/**'
- 'scripts/**'
- 'public/**'
- '.github/workflows/**'
- 'Dockerfile'
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # full history for changelog generation
# Clone the cms repo OUTSIDE the cms-docs workspace so Next.js's
# build doesn't try to type-check its examples. actions/checkout
# refuses paths above the runner workspace, so we shell-clone
# instead. Public repo, no token needed.
- name: Clone @webhouse/cms (outside workspace)
run: |
git clone --depth=200 https://github.com/webhousecode/cms.git /tmp/cms-source
# We need tags for the changelog generator, but not full history.
cd /tmp/cms-source && git fetch --tags --depth=200 origin
- uses: pnpm/action-setup@v4
with:
version: 10
- uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm
- run: pnpm install --frozen-lockfile
# Auto-regenerate changelog from cms repo's tags + commit log so
# it never goes stale between manual seeds. Replaces JSON files in
# content/changelog/ on every build (idempotent — same tags →
# same output).
- name: Regenerate changelog from cms repo
run: npx tsx scripts/seed-full-changelog.ts
env:
CMS_REPO: /tmp/cms-source
# Build
- run: pnpm build
# Deploy to Fly.io
- run: curl -L https://fly.io/install.sh | sh
- run: ~/.fly/bin/flyctl deploy --remote-only --now
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}