Skip to content

Commit c25e244

Browse files
committed
chore: switch website deployment to cloudflare workers
1 parent 8a68e7a commit c25e244

5 files changed

Lines changed: 21 additions & 60 deletions

File tree

.github/workflows/on-release-main.yml

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -43,44 +43,3 @@ jobs:
4343
run: uv publish
4444
env:
4545
UV_PUBLISH_TOKEN: ${{ secrets.PYPI_TOKEN }}
46-
47-
deploy-website:
48-
needs: publish
49-
runs-on: ubuntu-latest
50-
permissions:
51-
contents: read
52-
deployments: write
53-
steps:
54-
- name: Check out
55-
uses: actions/checkout@v6
56-
57-
- name: Set up Node
58-
uses: actions/setup-node@v6
59-
with:
60-
node-version-file: website/.node-version
61-
cache: pnpm
62-
cache-dependency-path: website/pnpm-lock.yaml
63-
64-
- name: Set up pnpm
65-
uses: pnpm/action-setup@v4
66-
with:
67-
version: 10
68-
69-
- name: Install website dependencies
70-
run: pnpm --dir website install --frozen-lockfile
71-
72-
- name: Build website
73-
env:
74-
SITE_URL: https://bub.build
75-
run: pnpm --dir website build
76-
77-
- name: Deploy website to Cloudflare Pages
78-
uses: cloudflare/wrangler-action@v3
79-
with:
80-
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
81-
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
82-
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
83-
command: >-
84-
pages deploy website/dist
85-
--project-name=${{ vars.CLOUDFLARE_PAGES_PROJECT_NAME }}
86-
--branch=main

justfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,4 +67,4 @@ docs:
6767
# Preview the production documentation build
6868
docs-preview:
6969
#!/usr/bin/env bash
70-
pnpm --dir website preview --host
70+
pnpm --dir website preview --ip 0.0.0.0

website/DEPLOYMENT.md

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,29 +6,29 @@ The new `website/` directory is the docs and marketing site for Bub.
66

77
Legacy MkDocs source files may still exist in the repository during the
88
transition, but production deployment now targets the Astro site on
9-
Cloudflare Pages.
9+
Cloudflare Workers.
1010

11-
## Cloudflare Pages
11+
## Cloudflare Workers
1212

13-
Connect the repository to a Cloudflare Pages project with Git integration.
13+
Connect the repository to a Cloudflare Worker using Git integration.
1414

1515
Recommended settings:
1616

17-
- Production branch: `main`
18-
- Root directory: `website`
17+
- Project name: `bub-website`
1918
- Build command: `pnpm install --frozen-lockfile && pnpm build`
20-
- Build output directory: `dist`
19+
- Deploy command: `pnpm wrangler deploy`
20+
- Path: `website`
2121
- Environment variable: `SITE_URL=https://bub.build`
2222
- Environment variable: `NODE_VERSION=22.16.0`
2323

2424
The repo also includes [wrangler.jsonc](./wrangler.jsonc) so local preview and
25-
Cloudflare Pages runtime settings stay aligned:
25+
Cloudflare Workers runtime settings stay aligned:
2626

27-
- `pages_build_output_dir = "./dist"`
27+
- `main = "./node_modules/@astrojs/cloudflare/dist/entrypoints/server.js"`
2828
- `compatibility_flags = ["nodejs_compat"]`
2929

30-
Production deployment is driven by GitHub release automation instead of
31-
push-based auto deploys.
30+
Production deployment is handled by Cloudflare Workers Git integration instead of
31+
GitHub Actions.
3232

3333
## Current Repo State
3434

@@ -40,18 +40,20 @@ The local developer entrypoints now target the new site:
4040

4141
The CI docs check also builds `website/` instead of MkDocs.
4242

43-
## GitHub Actions Deployment
43+
## GitHub Actions and Cloudflare Responsibilities
4444

4545
The deployment split is intentionally simple:
4646

4747
- `main.yml` only verifies that the website builds
48-
- `on-release-main.yml` deploys production when a GitHub release is published
48+
- `on-release-main.yml` only handles package release tasks
49+
- Cloudflare Workers deploys the website from the connected repository
4950

50-
Required repository configuration:
51+
Required Cloudflare Workers project configuration:
5152

52-
- GitHub Actions secret: `CLOUDFLARE_API_TOKEN`
53-
- GitHub Actions secret: `CLOUDFLARE_ACCOUNT_ID`
54-
- GitHub Actions variable: `CLOUDFLARE_PAGES_PROJECT_NAME`
53+
- Git integration enabled for this repository
54+
- Build command set to `pnpm install --frozen-lockfile && pnpm build`
55+
- Deploy command set to `pnpm wrangler deploy`
56+
- Working directory set to `website`
5557

5658
## Cutover Later
5759

website/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"scripts": {
99
"dev": "astro dev",
1010
"build": "astro build",
11-
"preview": "wrangler pages dev ./dist"
11+
"preview": "wrangler dev"
1212
},
1313
"dependencies": {
1414
"@astrojs/cloudflare": "^13.1.9",

website/wrangler.jsonc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"$schema": "./node_modules/wrangler/config-schema.json",
33
"name": "bub-website",
4-
"pages_build_output_dir": "./dist",
4+
"main": "./node_modules/@astrojs/cloudflare/dist/entrypoints/server.js",
55
"compatibility_date": "2026-04-15",
66
"compatibility_flags": [
77
"nodejs_compat"

0 commit comments

Comments
 (0)