Skip to content

Commit 3b31af1

Browse files
authored
Merge branch 'main' into keystatic/new_blogpost
2 parents d513221 + 40a0f69 commit 3b31af1

104 files changed

Lines changed: 5515 additions & 3306 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.env.example‎

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,2 @@
1-
# Use local file storage when these values are absent.
2-
# Set them on a Node.js-capable deployment to edit the GitHub repository online.
3-
NEXT_PUBLIC_KEYSTATIC_STORAGE_KIND=github
4-
NEXT_OUTPUT_MODE=server
5-
KEYSTATIC_GITHUB_CLIENT_ID=
6-
KEYSTATIC_GITHUB_CLIENT_SECRET=
7-
KEYSTATIC_SECRET=
8-
NEXT_PUBLIC_KEYSTATIC_GITHUB_APP_SLUG=
1+
# Content PR previews set this to true. Production must leave it false.
2+
PREFERREDAI_NOINDEX=false

‎.github/CODEOWNERS‎

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,8 @@
11
# Code and repository configuration default to the current maintainer.
22
* @hieuddo
33

4-
# Editorial blog content intentionally has no required code owner.
5-
/content/posts/**
6-
/public/uploads/**
7-
8-
# People content currently follows the same check-only policy as blog content.
9-
/content/people/**
10-
/public/team/members/**
11-
124
# Keep the publishing system and its ownership rules under technical review.
13-
/keystatic.config.ts @hieuddo
5+
/apps/admin/** @hieuddo
6+
/.github/workflows/nextjs.yml @hieuddo
7+
/.github/workflows/deploy-admin.yml @hieuddo
148
/.github/** @hieuddo

‎.github/dependabot.yml‎

Lines changed: 89 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,100 @@
11
version: 2
22
updates:
3-
- package-ecosystem: "npm"
3+
- package-ecosystem: "github-actions"
44
directory: "/"
55
schedule:
6-
interval: "weekly"
7-
day: "monday"
6+
interval: "monthly"
87
time: "00:00"
98
timezone: "Asia/Singapore"
109
open-pull-requests-limit: 5
10+
cooldown:
11+
default-days: 7
12+
groups:
13+
github-actions:
14+
patterns:
15+
- "*"
16+
17+
- package-ecosystem: "npm"
18+
directory: "/"
19+
schedule:
20+
interval: "monthly"
21+
time: "00:00"
22+
timezone: "Asia/Singapore"
23+
open-pull-requests-limit: 10
24+
cooldown:
25+
default-days: 7
26+
semver-major-days: 14
27+
semver-minor-days: 7
28+
semver-patch-days: 3
29+
1130
groups:
12-
npm-dependencies:
31+
# Tier 1: Core framework & React ecosystem
32+
react-next:
33+
patterns:
34+
- "next"
35+
- "react"
36+
- "react-dom"
37+
- "@types/react"
38+
- "@types/react-dom"
39+
update-types:
40+
- "patch"
41+
- "minor"
42+
43+
# Tier 2: CMS & Admin interface (@preferredai/admin)
44+
keystatic:
45+
patterns:
46+
- "@keystatic/*"
47+
- "@keystar/*"
48+
- "react-aria*"
49+
- "react-stately*"
50+
update-types:
51+
- "patch"
52+
- "minor"
53+
54+
# Tier 3: Cloudflare deployment & worker runtime
55+
cloudflare:
56+
patterns:
57+
- "@opennextjs/*"
58+
- "wrangler*"
59+
- "@cloudflare/*"
60+
update-types:
61+
- "patch"
62+
- "minor"
63+
64+
# Tier 4: Content & Markdown processing pipeline
65+
content-pipeline:
66+
patterns:
67+
- "unified"
68+
- "remark*"
69+
- "rehype*"
70+
- "unist*"
71+
- "@markdoc/*"
72+
- "gray-matter"
73+
- "katex"
74+
update-types:
75+
- "patch"
76+
- "minor"
77+
78+
# Tier 5: Styling & CSS utilities
79+
styling:
80+
patterns:
81+
- "tailwindcss*"
82+
- "@tailwindcss/*"
83+
- "tailwind-merge"
84+
- "clsx"
85+
update-types:
86+
- "patch"
87+
- "minor"
88+
89+
# Tier 6: Developer tooling, linters, compilers & types
90+
dev-tooling:
91+
dependency-type: "development"
92+
update-types:
93+
- "patch"
94+
- "minor"
95+
96+
# Tier 7: Remaining production dependencies (utilities like date-fns, feed, sharp)
97+
other-dependencies:
1398
patterns:
1499
- "*"
15100
update-types:

‎.github/workflows/deploy-admin.yml‎

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
name: Deploy Keystatic admin Worker
2+
3+
on:
4+
push:
5+
branches: ["main"]
6+
paths:
7+
- "apps/admin/**"
8+
- "package.json"
9+
- "pnpm-lock.yaml"
10+
- "pnpm-workspace.yaml"
11+
- ".github/workflows/deploy-admin.yml"
12+
workflow_dispatch:
13+
14+
permissions:
15+
contents: read
16+
17+
concurrency:
18+
group: admin-worker-production
19+
cancel-in-progress: false
20+
21+
jobs:
22+
build:
23+
runs-on: ubuntu-latest
24+
steps:
25+
- name: Check out trusted admin code
26+
uses: actions/checkout@v7
27+
with:
28+
persist-credentials: false
29+
30+
- name: Set up pnpm
31+
uses: pnpm/action-setup@v6
32+
33+
- name: Set up Node.js
34+
uses: actions/setup-node@v7
35+
with:
36+
node-version: "22"
37+
cache: pnpm
38+
39+
- name: Install dependencies
40+
run: pnpm install --frozen-lockfile
41+
42+
- name: Type-check admin application
43+
run: pnpm --filter @preferredai/admin typecheck
44+
45+
- name: Build admin Worker without deployment secrets
46+
env:
47+
KEYSTATIC_GITHUB_CLIENT_ID: build-placeholder
48+
KEYSTATIC_GITHUB_CLIENT_SECRET: build-placeholder
49+
KEYSTATIC_SECRET: 0000000000000000000000000000000000000000000000000000000000000000
50+
NEXT_PUBLIC_KEYSTATIC_STORAGE_KIND: github
51+
NEXT_PUBLIC_KEYSTATIC_GITHUB_APP_SLUG: preferredai-keystatic
52+
run: pnpm --filter @preferredai/admin build:worker
53+
54+
- name: Upload Worker bundle
55+
uses: actions/upload-artifact@v7
56+
with:
57+
name: admin-worker
58+
path: |
59+
apps/admin/.open-next
60+
apps/admin/wrangler.jsonc
61+
include-hidden-files: true
62+
if-no-files-found: error
63+
retention-days: 3
64+
65+
deploy:
66+
needs: build
67+
runs-on: ubuntu-latest
68+
environment:
69+
name: admin-production
70+
url: https://admin.preferred.ai/keystatic
71+
steps:
72+
- name: Download Worker bundle
73+
uses: actions/download-artifact@v8
74+
with:
75+
name: admin-worker
76+
path: admin-worker
77+
78+
- name: Deploy editor-only Worker
79+
uses: cloudflare/wrangler-action@v4
80+
with:
81+
apiToken: ${{ secrets.CLOUDFLARE_WORKERS_API_TOKEN }}
82+
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
83+
workingDirectory: admin-worker
84+
packageManager: npm
85+
wranglerVersion: 4.124.0
86+
command: deploy --config wrangler.jsonc --keep-vars
87+
88+
- name: Smoke-test admin origin
89+
shell: bash
90+
run: |
91+
set -euo pipefail
92+
curl --fail --silent --show-error --location --retry 10 --retry-all-errors https://admin.preferred.ai/keystatic > /dev/null
93+
status="$(curl --silent --output /dev/null --write-out '%{http_code}' https://admin.preferred.ai/)"
94+
test "$status" = "307" -o "$status" = "308"

0 commit comments

Comments
 (0)