fix(ci): redeploy docs after package publishing

This commit is contained in:
t8y2 2026-05-18 10:43:47 +08:00
parent c6d196611b
commit 4089a2de7a
2 changed files with 8 additions and 3 deletions

View File

@ -4,6 +4,9 @@ on:
push:
branches: [main]
paths: ['docs/**']
workflow_run:
workflows: ['Publish Packages']
types: [completed]
workflow_dispatch:
permissions:
@ -16,6 +19,7 @@ concurrency:
jobs:
build:
if: github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

View File

@ -57,11 +57,12 @@ test("legacy docs changelog pages do not keep stale release entries", () => {
assert.match(cn, /\/cn\/changelog/);
});
test("docs deploy does not rerun just to refresh R2 changelog data", () => {
test("docs deploy reruns after package publishing refreshes latest release data", () => {
const source = readFileSync(".github/workflows/docs.yml", "utf8");
assert.equal(source.includes("workflow_run:"), false);
assert.equal(source.includes("Sync Changelog to R2"), false);
assert.match(source, /workflow_run:/);
assert.match(source, /workflows: \['Publish Packages'\]/);
assert.match(source, /github\.event\.workflow_run\.conclusion == 'success'/);
});
test("changelog sync does not configure bucket-level R2 CORS during upload", () => {