Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions .github/workflows/deploy-writer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ jobs:
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
VITE_MDBASE_FEEDBACK_URL: ${{ vars.MDBASE_FEEDBACK_URL }}
VITE_MDBASE_FEEDBACK_TURNSTILE_SITE_KEY: ${{ vars.MDBASE_FEEDBACK_TURNSTILE_SITE_KEY }}
VITE_MDBASE_FEEDBACK_URL: ${{ inputs.target == 'production' && 'https://feedback-api.mdbase.dev/v1/feedback' || 'https://feedback-api-staging.mdbase.dev/v1/feedback' }}
VITE_MDBASE_FEEDBACK_TURNSTILE_SITE_KEY: ${{ inputs.target == 'production' && '0x4AAAAAAEboz_mLT-taI3H-' || '0x4AAAAAAEbkvA4d9vQJq2D1' }}
- name: Verify deployed manifest
env:
ORIGIN: ${{ inputs.target == 'production' && 'https://writer.mdbase.dev' || 'https://staging.mdbase-writer.pages.dev' }}
Expand Down Expand Up @@ -139,6 +139,9 @@ jobs:
env:
TARGET: ${{ inputs.target }}
SOURCE_SHA: ${{ inputs.source_sha }}
# Public build inputs: Pages runtime variables do not configure Vite assets.
VITE_MDBASE_FEEDBACK_URL: ${{ inputs.target == 'production' && 'https://feedback-api.mdbase.dev/v1/feedback' || 'https://feedback-api-staging.mdbase.dev/v1/feedback' }}
VITE_MDBASE_FEEDBACK_TURNSTILE_SITE_KEY: ${{ inputs.target == 'production' && '0x4AAAAAAEboz_mLT-taI3H-' || '0x4AAAAAAEbkvA4d9vQJq2D1' }}
NATIVE_SDK_SHA256: ${{ needs.native-inputs.outputs.sdk }}
NATIVE_UI_SHA256: ${{ needs.native-inputs.outputs.ui }}
NATIVE_PROTOCOL_SHA256: ${{ needs.native-inputs.outputs.protocol }}
Expand Down
13 changes: 13 additions & 0 deletions tests/feedback-deployment.test.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import assert from "node:assert/strict";
import { readFile } from "node:fs/promises";
import test from "node:test";

test("legacy and native Writer builds retain matching public feedback configuration", async () => {
const workflow = await readFile(new URL("../.github/workflows/deploy-writer.yml", import.meta.url), "utf8");
const legacy = workflow.split("\n deploy:")[1].split("\n native-dispatch:")[0];
const native = workflow.split("\n native-build:")[1].split("\n native-deploy:")[0];
for (const job of [legacy, native]) {
assert.ok(job.includes("VITE_MDBASE_FEEDBACK_URL: " + "${{ inputs.target == 'production' && 'https://feedback-api.mdbase.dev/v1/feedback' || 'https://feedback-api-staging.mdbase.dev/v1/feedback' }}"));
assert.ok(job.includes("VITE_MDBASE_FEEDBACK_TURNSTILE_SITE_KEY: " + "${{ inputs.target == 'production' && '0x4AAAAAAEboz_mLT-taI3H-' || '0x4AAAAAAEbkvA4d9vQJq2D1' }}"));
}
});