Scope preview deployments by hosted site

This commit is contained in:
Kevin
2026-09-02 02:24:01 -04:00
parent cfa91c3025
commit 12b82c31f1
3 changed files with 68 additions and 10 deletions
+46
View File
@@ -0,0 +1,46 @@
name: Deploy blog static Worker preview
on:
push:
branches: [astro-platform-pilot]
paths:
- .gitea/workflows/deploy-blog.yml
- astro.config.mjs
- package.json
- package-lock.json
- public/**
- schemas/**
- scripts/**
- sites.json
- sites/blog/**
- src/**
- wrangler/blog.jsonc
workflow_dispatch:
jobs:
preview:
name: Preview blog
runs-on: ubuntu-latest
permissions:
contents: read
env:
SITE_KEY: blog
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 selected site
run: npm run build:site
- name: Verify selected output
run: npm run verify:build
- name: Deploy non-production Worker
run: npx wrangler deploy --config wrangler/blog.jsonc
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CF_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CF_ACCOUNT_ID }}
+15 -7
View File
@@ -1,22 +1,30 @@
name: Validate and deploy static Worker preview name: Deploy primary static Worker preview
on: on:
push: push:
branches: [astro-platform-pilot] branches: [astro-platform-pilot]
paths:
- .gitea/workflows/deploy.yml
- astro.config.mjs
- package.json
- package-lock.json
- public/**
- schemas/**
- scripts/**
- sites.json
- sites/www/**
- src/**
- wrangler/www.jsonc
workflow_dispatch: workflow_dispatch:
jobs: jobs:
preview: preview:
name: Preview ${{ matrix.site_key }} name: Preview www
runs-on: ubuntu-latest runs-on: ubuntu-latest
permissions: permissions:
contents: read contents: read
strategy:
fail-fast: false
matrix:
site_key: [www, blog]
env: env:
SITE_KEY: ${{ matrix.site_key }} SITE_KEY: www
ASTRO_TELEMETRY_DISABLED: '1' ASTRO_TELEMETRY_DISABLED: '1'
steps: steps:
- name: Checkout source - name: Checkout source
+7 -3
View File
@@ -5,9 +5,13 @@ the same root repository. Its non-production Worker is
`3031023-xyz-blog-preview` and its workers.dev preview URL is published by `3031023-xyz-blog-preview` and its workers.dev preview URL is published by
Cloudflare after the pilot workflow completes. Cloudflare after the pilot workflow completes.
This preview has no custom domain, route, or production DNS record. The future The Worker is now attached only to `blog.3031023.xyz` for the Phase 5 hosted
`blog.3031023.xyz` attachment is a separate Phase 5 approval step that follows subdomain test. Its deployed preview build intentionally remains `noindex` and
the accepted primary-domain cutover. disallows crawling until a separately approved production blog release exists.
The sample posts remain structured site data for this pilot. Markdown content The sample posts remain structured site data for this pilot. Markdown content
collections and any editor/CMS workflow are explicitly deferred. collections and any editor/CMS workflow are explicitly deferred.
Primary-only content changes deploy only the primary preview Worker;
blog-only content changes deploy only this Worker; shared source changes deploy
both. Each workflow has explicit path filters to enforce that boundary.