From 5c59430b86540bdc67f67caa8c11c8dc61d70654 Mon Sep 17 00:00:00 2001 From: Kevin Date: Wed, 2 Sep 2026 10:51:23 -0400 Subject: [PATCH] Add production blog Worker workflow --- .gitea/workflows/production-blog.yml | 47 ++++++++++++++++++++++++++++ README.md | 3 ++ docs/blog-preview.md | 7 +++-- docs/blog-production-runbook.md | 40 +++++++++++++++++++++++ sites.json | 4 +-- wrangler/blog.production.jsonc | 7 +++++ 6 files changed, 103 insertions(+), 5 deletions(-) create mode 100644 .gitea/workflows/production-blog.yml create mode 100644 docs/blog-production-runbook.md create mode 100644 wrangler/blog.production.jsonc diff --git a/.gitea/workflows/production-blog.yml b/.gitea/workflows/production-blog.yml new file mode 100644 index 0000000..97df055 --- /dev/null +++ b/.gitea/workflows/production-blog.yml @@ -0,0 +1,47 @@ +name: Deploy blog production Worker + +on: + push: + branches: [main] + paths: + - .gitea/workflows/production-blog.yml + - astro.config.mjs + - package.json + - package-lock.json + - public/** + - schemas/** + - scripts/** + - sites.json + - sites/blog/** + - src/** + - wrangler/blog.production.jsonc + workflow_dispatch: + +jobs: + production: + name: Build and deploy blog.3031023.xyz production + runs-on: ubuntu-latest + permissions: + contents: read + env: + SITE_KEY: blog + DEPLOY_ENV: production + ASTRO_TELEMETRY_DISABLED: '1' + steps: + - name: Checkout source + uses: https://github.com/actions/checkout@v4 + - name: Use Node 22 + uses: https://github.com/actions/setup-node@v4 + with: + node-version: 22 + - name: Install locked dependencies + run: npm ci + - name: Validate and build production blog + run: npm run build:site + - name: Verify production blog output + run: npm run verify:build + - name: Deploy Worker without custom domains or routes + run: npx wrangler deploy --config wrangler/blog.production.jsonc + env: + CLOUDFLARE_API_TOKEN: ${{ secrets.CF_API_TOKEN }} + CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CF_ACCOUNT_ID }} diff --git a/README.md b/README.md index 639e0e6..88c1ef3 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,9 @@ The Gitea workflows deploy scoped non-production Workers from every non-`main` branch: `3031023-xyz-www-preview` for primary-site changes and `3031023-xyz-blog-preview` for blog changes. Relevant primary-site pushes to `main` deploy the existing `3031023-xyz-www` production Worker automatically. +Relevant blog pushes to `main` deploy the separate `3031023-xyz-blog` +production Worker automatically. Both production workflows deploy static assets +only. It uses the existing `CF_API_TOKEN` and `CF_ACCOUNT_ID`. The token retains the Pages permissions needed for the `main` rollback target and now also permits the non-production Worker preview deployment. diff --git a/docs/blog-preview.md b/docs/blog-preview.md index 9ff05f4..fb37782 100644 --- a/docs/blog-preview.md +++ b/docs/blog-preview.md @@ -5,9 +5,10 @@ the same root repository. Its non-production Worker is `3031023-xyz-blog-preview` and its workers.dev preview URL is published by Cloudflare after the pilot workflow completes. -The Worker is now attached only to `blog.3031023.xyz` for the Phase 5 hosted -subdomain test. Its deployed preview build intentionally remains `noindex` and -disallows crawling until a separately approved production blog release exists. +The preview Worker remains attached only to `blog.3031023.xyz` during the +hosted-test period. Its deployed preview build intentionally remains `noindex` +and disallows crawling until the separately deployed production blog Worker is +verified and the domain move is approved. The sample posts remain structured site data for this pilot. Markdown content collections and any editor/CMS workflow are explicitly deferred. diff --git a/docs/blog-production-runbook.md b/docs/blog-production-runbook.md new file mode 100644 index 0000000..535be82 --- /dev/null +++ b/docs/blog-production-runbook.md @@ -0,0 +1,40 @@ +# Blog production Worker runbook + +## Scope and safety boundary + +This runbook moves only `blog.3031023.xyz` from the independent preview Worker +to the independent static production Worker `3031023-xyz-blog`. It does not +change the primary site, the Pages rollback project, DNS records, redirects, +forms, n8n, onboarding, CMS, or client-editing boundaries. + +The routine workflows deploy static assets only: + +- relevant `main` changes deploy `3031023-xyz-blog` in production mode; +- relevant non-`main` changes deploy `3031023-xyz-blog-preview` in preview + mode; and +- neither workflow can create, remove, or alter custom domains, DNS, routes, + or redirects. + +## Pre-cutover verification + +1. Record the production Worker version and verify its `workers.dev` URL. +2. Confirm the journal home page and all published post pages return 200. +3. Confirm a nonexistent post returns the static 404. +4. Confirm production metadata is indexable, `robots.txt` allows crawling, and + the sitemap lists the journal and published posts. +5. Confirm the preview Worker remains untouched and its current deployment is + available as the immediate blog rollback target. + +## Domain move (requires separate approval) + +1. Remove `blog.3031023.xyz` from `3031023-xyz-blog-preview`; do not delete + that Worker or its deployment history. +2. Attach `blog.3031023.xyz` to `3031023-xyz-blog` as its only custom domain. +3. Re-run the public verification checks against the hostname. + +## Rollback + +1. Remove `blog.3031023.xyz` from `3031023-xyz-blog`. +2. Reattach it to the unchanged `3031023-xyz-blog-preview` Worker. +3. Verify the preview Worker’s known-good deployment at the hostname. The + preview build will intentionally return to its no-index behavior. diff --git a/sites.json b/sites.json index 37cbcfd..dfe08b1 100644 --- a/sites.json +++ b/sites.json @@ -12,9 +12,9 @@ }, "blog": { "hostname": "blog.3031023.xyz", - "workerName": "3031023-xyz-blog-preview", + "workerName": "3031023-xyz-blog", "contactSiteKey": "3031023-xyz-blog", - "status": "preview" + "status": "production" } } } diff --git a/wrangler/blog.production.jsonc b/wrangler/blog.production.jsonc new file mode 100644 index 0000000..d2fd0b4 --- /dev/null +++ b/wrangler/blog.production.jsonc @@ -0,0 +1,7 @@ +{ + "$schema": "../node_modules/wrangler/config-schema.json", + "name": "3031023-xyz-blog", + "compatibility_date": "2026-09-02", + "workers_dev": true, + "assets": { "directory": "../dist/blog", "not_found_handling": "404-page" } +}