41 lines
1.2 KiB
YAML
41 lines
1.2 KiB
YAML
name: Validate and deploy static Worker preview
|
|
|
|
on:
|
|
push:
|
|
branches: [astro-platform-pilot]
|
|
workflow_dispatch:
|
|
inputs:
|
|
site_key:
|
|
description: Site key to deploy to its non-production Worker
|
|
required: true
|
|
type: choice
|
|
options: [www, blog]
|
|
|
|
jobs:
|
|
preview:
|
|
name: Preview ${{ inputs.site_key || 'www' }}
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
env:
|
|
SITE_KEY: ${{ inputs.site_key || 'www' }}
|
|
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/${SITE_KEY}.jsonc"
|
|
env:
|
|
CLOUDFLARE_API_TOKEN: ${{ secrets.CF_WORKER_PREVIEW_TOKEN }}
|
|
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CF_ACCOUNT_ID }}
|