diff --git a/.gitea/workflows/deploy-blog.yml b/.gitea/workflows/deploy-blog.yml index f89a8fc..8cfb55f 100644 --- a/.gitea/workflows/deploy-blog.yml +++ b/.gitea/workflows/deploy-blog.yml @@ -1,4 +1,4 @@ -name: Deploy blog static Worker preview +name: Upload blog Worker preview version on: push: @@ -19,7 +19,7 @@ on: jobs: preview: - name: Preview blog + name: Preview blog version runs-on: ubuntu-latest permissions: contents: read @@ -39,8 +39,12 @@ jobs: 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 + - name: Upload non-production preview version + run: | + raw_ref="${GITHUB_REF_NAME:-${GITEA_REF_NAME:-preview}}" + preview_alias="$(printf '%s' "$raw_ref" | tr '[:upper:]' '[:lower:]' | sed -E 's/[^a-z0-9-]+/-/g; s/^-+//; s/-+$//' | cut -c1-40)" + preview_alias="${preview_alias:-preview}" + npx wrangler versions upload --config wrangler/blog.production.jsonc --preview-alias "$preview_alias" env: CLOUDFLARE_API_TOKEN: ${{ secrets.CF_API_TOKEN }} CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CF_ACCOUNT_ID }} diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index b75a66a..c5d57ae 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -1,4 +1,4 @@ -name: Deploy primary static Worker preview +name: Upload primary Worker preview version on: push: @@ -19,7 +19,7 @@ on: jobs: preview: - name: Preview www + name: Preview www version runs-on: ubuntu-latest permissions: contents: read @@ -39,8 +39,12 @@ jobs: 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" + - name: Upload non-production preview version + run: | + raw_ref="${GITHUB_REF_NAME:-${GITEA_REF_NAME:-preview}}" + preview_alias="$(printf '%s' "$raw_ref" | tr '[:upper:]' '[:lower:]' | sed -E 's/[^a-z0-9-]+/-/g; s/^-+//; s/-+$//' | cut -c1-40)" + preview_alias="${preview_alias:-preview}" + npx wrangler versions upload --config wrangler/www.production.jsonc --preview-alias "$preview_alias" env: CLOUDFLARE_API_TOKEN: ${{ secrets.CF_API_TOKEN }} CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CF_ACCOUNT_ID }} diff --git a/README.md b/README.md index 88c1ef3..69d7984 100644 --- a/README.md +++ b/README.md @@ -33,13 +33,12 @@ routes, account IDs, or secrets. ## Preview deployment -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. +The Gitea workflows upload scoped non-production preview versions of the +production Workers from every non-`main` branch. Cloudflare assigns each branch +a readable `workers.dev` preview alias without changing production traffic. +Relevant primary-site pushes to `main` deploy `3031023-xyz-www`, and relevant +blog pushes to `main` deploy `3031023-xyz-blog`, 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/scripts/verify-build.mjs b/scripts/verify-build.mjs index afebb7a..df5ce6a 100644 --- a/scripts/verify-build.mjs +++ b/scripts/verify-build.mjs @@ -17,7 +17,7 @@ for (const { file, html } of pages) { const home = await readFile(resolve(root, 'index.html'), 'utf8'); if (key === 'www') { - if (!home.includes('What services do you offer?') || !home.includes('How do I book a visit?')) throw new Error('Primary FAQ Markdown entries are missing from the homepage.'); + for (const question of ['What services do you offer?', 'How do I book a visit?', 'How far ahead should I book pet care?', 'Can you accommodate special routines?']) if (!home.includes(question)) throw new Error(`Primary FAQ Markdown entry is missing: ${question}.`); if (home.includes('What information should I bring to a meet and greet?')) throw new Error('Draft FAQ entry appeared in the homepage.'); const services = await readFile(resolve(root, 'services/index.html'), 'utf8'); for (const title of ['Dog walking', 'Grooming', 'Overnight care']) if (!services.includes(title)) throw new Error(`Service Markdown entry is missing: ${title}.`); @@ -25,7 +25,7 @@ if (key === 'www') { for (const name of ['Sarah Mitchell', 'Marcus Rivera', 'Emily Chen', 'David Okonkwo']) if (!about.includes(name)) throw new Error(`Team Markdown entry is missing: ${name}.`); } if (key === 'blog') { - const publishedPosts = ['first-walk-after-work', 'gentler-grooming-day', 'overnight-care-checklist']; + const publishedPosts = ['first-walk-after-work', 'gentler-grooming-day', 'overnight-care-checklist', 'weekend-care-prep']; await Promise.all(publishedPosts.map((slug) => access(resolve(root, `posts/${slug}/index.html`)))); if (home.includes('Draft only example for editorial review')) throw new Error('Draft blog post appeared in the journal.'); try { diff --git a/sites/blog/content/posts/weekend-care-prep.md b/sites/blog/content/posts/weekend-care-prep.md new file mode 100644 index 0000000..b6c2d7b --- /dev/null +++ b/sites/blog/content/posts/weekend-care-prep.md @@ -0,0 +1,15 @@ +--- +title: A simple weekend-care checklist for your dog +description: A calm, practical checklist to help your dog keep familiar routines while you are away for the weekend. +pubDate: 2026-09-02 +tags: + - Overnight care + - Planning +draft: false +--- + +Before a weekend away, share your dog's feeding rhythm, favorite walking route, +comfort items, and any little details that help a new routine feel familiar. + +The goal is not a perfect schedule. It is a calm handoff that gives your dog +familiar cues and gives you confidence while you are away. diff --git a/sites/www/content/faq/booking-lead-time.md b/sites/www/content/faq/booking-lead-time.md new file mode 100644 index 0000000..60b7651 --- /dev/null +++ b/sites/www/content/faq/booking-lead-time.md @@ -0,0 +1,10 @@ +--- +question: How far ahead should I book pet care? +category: Booking +order: 30 +draft: false +--- + +For this pilot, the best answer is to reach out as soon as you know your dates. +A live Happy Tails site would replace this sample guidance with the business's +actual availability, booking window, and cancellation policy. diff --git a/sites/www/content/faq/special-routines.md b/sites/www/content/faq/special-routines.md new file mode 100644 index 0000000..81b5622 --- /dev/null +++ b/sites/www/content/faq/special-routines.md @@ -0,0 +1,10 @@ +--- +question: Can you accommodate special routines? +category: Care preferences +order: 40 +draft: false +--- + +This pilot's answer is a starting point: share feeding notes, medication +instructions, mobility needs, and comfort cues before the first visit. A live +site would publish only the care practices the business has approved.