Skip to content

Commit 44b6dbc

Browse files
committed
TCLOUD-4780: Move the generation of redirects to an action
1 parent 36b3fe4 commit 44b6dbc

File tree

4 files changed

+11
-345
lines changed

4 files changed

+11
-345
lines changed

.github/workflows/preview_create.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,11 @@ jobs:
4343
- name: Build Website
4444
run: yarn antora ./antora-playbook.yml
4545

46-
- name: Rename site
46+
- name: Rename site folder to docs
4747
run: |
4848
mv ./build/site ./build/docs
4949
50-
- name: Rename sitemap.xml
50+
- name: Rename sitemap.xml to antora-sitemap.xml
5151
run: |
5252
mv ./build/docs/sitemap.xml ./build/docs/antora-sitemap.xml
5353
@@ -63,8 +63,13 @@ jobs:
6363
aws s3 sync ./build s3://tiny-cloud-antora-docs-preview/${PR}/${RUN}
6464
6565
- name: Create redirects on S3
66-
run: |
67-
node .github/workflows/scripts/generate_redirects.mjs tiny-cloud-antora-docs-preview ${PR}/${RUN} --parallel 5
66+
uses: tinymce/tinymce-docs-generate-redirects-action@feature/TCLOUD-4780
67+
with:
68+
build: ./build/
69+
redirects: ./redirects.json
70+
bucket: tiny-cloud-antora-docs-preview
71+
prefix: ${PR}/${RUN}
72+
parallel: 10
6873

6974
- name: Update pointer to current run output # put in the docs subfolder as we rely on that path in redirects
7075
run: |

.github/workflows/preview_delete.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ permissions:
1010
id-token: write
1111

1212
env:
13-
PR_NUMBER: ${{ github.event.number }}
13+
PR: pr-${{ github.event.number }}
1414

1515
jobs:
1616
cleanup:
@@ -41,4 +41,4 @@ jobs:
4141

4242
- name: Remove website preview from S3
4343
run: |
44-
aws s3 rm s3://tiny-cloud-antora-docs-preview/pr${PR_NUMBER}
44+
aws s3 rm s3://tiny-cloud-antora-docs-preview/${PR}

.github/workflows/scripts/empty.html

Lines changed: 0 additions & 1 deletion
This file was deleted.

.github/workflows/scripts/generate_redirects.mjs

Lines changed: 0 additions & 338 deletions
This file was deleted.

0 commit comments

Comments
 (0)