Automate primary production deployments from main

This commit is contained in:
Kevin
2026-09-02 10:47:46 -04:00
parent 1b25dc37a6
commit 954b230d05
5 changed files with 31 additions and 18 deletions
+1 -1
View File
@@ -2,7 +2,7 @@ name: Deploy blog static Worker preview
on: on:
push: push:
branches: [astro-platform-pilot, markdown-content-pilot] branches-ignore: [main]
paths: paths:
- .gitea/workflows/deploy-blog.yml - .gitea/workflows/deploy-blog.yml
- astro.config.mjs - astro.config.mjs
+1 -1
View File
@@ -2,7 +2,7 @@ name: Deploy primary static Worker preview
on: on:
push: push:
branches: [astro-platform-pilot, markdown-content-pilot] branches-ignore: [main]
paths: paths:
- .gitea/workflows/deploy.yml - .gitea/workflows/deploy.yml
- astro.config.mjs - astro.config.mjs
+18 -7
View File
@@ -1,14 +1,25 @@
name: Deploy primary production Worker candidate name: Deploy primary production Worker
on: on:
push: push:
branches: [astro-platform-pilot] branches: [main]
paths: [.gitea/workflows/production-candidate.yml] paths:
- .gitea/workflows/production-candidate.yml
- astro.config.mjs
- package.json
- package-lock.json
- public/**
- schemas/**
- scripts/**
- sites.json
- sites/www/**
- src/**
- wrangler/www.production.jsonc
workflow_dispatch: workflow_dispatch:
jobs: jobs:
candidate: production:
name: Build and deploy 3031023.xyz candidate name: Build and deploy 3031023.xyz production
runs-on: ubuntu-latest runs-on: ubuntu-latest
permissions: permissions:
contents: read contents: read
@@ -25,9 +36,9 @@ jobs:
node-version: 22 node-version: 22
- name: Install locked dependencies - name: Install locked dependencies
run: npm ci run: npm ci
- name: Validate and build production candidate - name: Validate and build production site
run: npm run build:site run: npm run build:site
- name: Verify production candidate output - name: Verify production output
run: npm run verify:build run: npm run verify:build
- name: Deploy Worker without custom domains or routes - name: Deploy Worker without custom domains or routes
run: npx wrangler deploy --config wrangler/www.production.jsonc run: npx wrangler deploy --config wrangler/www.production.jsonc
+4 -3
View File
@@ -33,9 +33,10 @@ routes, account IDs, or secrets.
## Preview deployment ## Preview deployment
The Gitea workflows deploy scoped non-production Workers from the pilot and The Gitea workflows deploy scoped non-production Workers from every non-`main`
Markdown-test branches: `3031023-xyz-www-preview` for primary-site changes and branch: `3031023-xyz-www-preview` for primary-site changes and
`3031023-xyz-blog-preview` for blog changes. `3031023-xyz-blog-preview` for blog changes. Relevant primary-site pushes to
`main` deploy the existing `3031023-xyz-www` production Worker automatically.
It uses the existing `CF_API_TOKEN` and `CF_ACCOUNT_ID`. The token retains the 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 Pages permissions needed for the `main` rollback target and now also permits
the non-production Worker preview deployment. the non-production Worker preview deployment.
+7 -6
View File
@@ -20,10 +20,10 @@ static assets to a distinct Worker.
- Existing Pages production deployment: `2fb1b659-5928-4470-bb04-ef4c9105b843` - Existing Pages production deployment: `2fb1b659-5928-4470-bb04-ef4c9105b843`
from the `main` branch. from the `main` branch.
- Preview Worker: `3031023-xyz-www-preview`, with no custom domains or routes. - Preview Worker: `3031023-xyz-www-preview`, with no custom domains or routes.
- Production candidate Worker: `3031023-xyz-www`, deployed only through the - Production Worker: `3031023-xyz-www`, deployed by the dedicated `Deploy
dedicated `Deploy primary production Worker candidate` workflow. Its push primary production Worker` workflow for relevant pushes to `main`. The
trigger is limited to changes to that workflow file; ordinary site commits workflow updates static assets only; it cannot change DNS, custom domains,
cannot update this Worker. routes, or redirect rules.
## Cutover sequence (requires separate approval) ## Cutover sequence (requires separate approval)
@@ -76,8 +76,9 @@ the cutover. Review it with the site's AI-search policy before final acceptance.
- Source commit: `2b7f8d8` (`main`), the accepted Git-backed Markdown content - Source commit: `2b7f8d8` (`main`), the accepted Git-backed Markdown content
pilot. pilot.
- Release path: the manually approved `Deploy primary production Worker - Release path: the manually approved production workflow completed
candidate` workflow completed successfully in 22 seconds. successfully in 22 seconds. Subsequent relevant `main` pushes use the same
static-asset-only workflow automatically.
- Scope: updated only the static assets of the existing `3031023-xyz-www` - Scope: updated only the static assets of the existing `3031023-xyz-www`
Worker. No custom domain, DNS, redirect rule, Pages project, form workflow, Worker. No custom domain, DNS, redirect rule, Pages project, form workflow,
CMS, or client-editing boundary changed. CMS, or client-editing boundary changed.