Skip to content

Commit 8f8e957

Browse files
committed
TCLOUD-4780 Support atomic updates
1 parent d4c631f commit 8f8e957

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

.github/workflows/preview_create.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,12 @@ jobs:
5959

6060
- name: Upload website preview to S3 # put in the docs subfolder as we rely on that path in redirects
6161
run: |
62-
aws s3 sync --delete ./build s3://tiny-cloud-antora-docs-preview/pr${PR_NUMBER}
62+
aws s3 sync ./build s3://tiny-cloud-antora-docs-preview/pr${PR_NUMBER}/${GITHUB_RUN_ATTEMPT}
6363
6464
- name: Create redirects on S3
65-
run: node ./.github/workflows/scripts/generate_redirects.mjs tiny-cloud-antora-docs-preview pr${PR_NUMBER}
65+
run: |
66+
node .github/workflows/scripts/generate_redirects.mjs tiny-cloud-antora-docs-preview pr${PR_NUMBER}/${GITHUB_RUN_ATTEMPT}
67+
68+
- name: Update pointer to current run output # put in the docs subfolder as we rely on that path in redirects
69+
run: |
70+
aws s3api put-object --bucket tiny-cloud-antora-docs-preview --key pr${PR_NUMBER}/index.html --body .github/workflows/scripts/empty.html --content-type text/html --metadata pointer=${GITHUB_RUN_ATTEMPT}

.github/workflows/scripts/generate_redirects.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ const main = async () => {
339339
return Promise.reject(`Invalid bucket name, got ${bucket}`);
340340
}
341341

342-
if (!/^[a-z0-9\.-]+$/.test(prefix)) {
342+
if (!/^[a-z0-9\.-]+(\/[a-z0-9\.-]+)*$/.test(prefix)) {
343343
return Promise.reject(`Invalid prefix, got ${prefix}`);
344344
}
345345

0 commit comments

Comments
 (0)