Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
c0127be
TCLOUD-4780: Created workflows for automatic previews
tiny-james Oct 3, 2025
ff18535
TCLOUD-4780: Set working directory only for the one step
tiny-james Oct 3, 2025
3bc12d6
TCLOUD-4780: Replace shell code that failed with nodejs
tiny-james Oct 3, 2025
a11cada
TCLOUD-4780: Setting permissions for id-token to write
tiny-james Oct 3, 2025
71fe97f
TCLOUD-4780: Switch to using PR number instead of branch name
tiny-james Oct 7, 2025
e1c8f85
TCLOUD-4780: Removed branch restriction
tiny-james Oct 7, 2025
5706df1
TCLOUD-4780: Avoid creating the docs subdirectory
tiny-james Oct 17, 2025
3a8e729
TCLOUD-4780: Re-add the docs folder segment for redirects
tiny-james Oct 21, 2025
07c1510
TCLOUD-4780: Generating redirects
tiny-james Oct 31, 2025
14d9028
TCLOUD-4780: Make script parallel to speed up object creation
tiny-james Nov 3, 2025
985696c
TCLOUD-4780: Increased parallel s3 operations to 20
tiny-james Nov 3, 2025
1f7bd30
TCLOUD-4780: Create redirects in github action
tiny-james Nov 3, 2025
28a707f
TCLOUD-4780: Ensure the clean up of redirects
tiny-james Nov 4, 2025
15a05ff
TCLOUD-4780: Use Lua replacment string "%1" instead of "$1"
tiny-james Nov 4, 2025
fae80ad
TCLOUD-4780: Fixed missing semicolon
tiny-james Nov 5, 2025
7f0f6b0
TCLOUD-4780: Use crypto to make the temporary file name unpredictable
tiny-james Nov 5, 2025
88f5f20
TCLOUD-4780: Use preexisting file as redirect file template
tiny-james Nov 5, 2025
d4c631f
TCLOUD-4780: Add additional metadata header to indicate 404s
tiny-james Nov 5, 2025
8f8e957
TCLOUD-4780 Support atomic updates
tiny-james Nov 5, 2025
3a992a9
TCLOUD-4780: Remove `--if-none-match` as it seems unsupported
tiny-james Nov 5, 2025
da88285
TCLOUD-4780: Prefix the run number so it's more readable
tiny-james Nov 5, 2025
e611136
TCLOUD-4780: Improve output prefix
tiny-james Nov 5, 2025
7c03623
TCLOUD-4780: Fix typo
tiny-james Nov 5, 2025
dfe1c4f
TCLOUD-4780: Try redirect without URL encoding
tiny-james Nov 5, 2025
5a3deb9
TCLOUD-4780: Reduce logging
tiny-james Nov 5, 2025
6739223
TCLOUD-4780: Fix a strange redirect
tiny-james Nov 5, 2025
b9aa8c7
TCLOUD-4780: Try --parallel 5
tiny-james Nov 5, 2025
0647c2b
TCLOUD-4780: Try --parallel 2
tiny-james Nov 5, 2025
feff106
TCLOUD-4780: Try --parallel 10
tiny-james Nov 5, 2025
f0cbfbe
TCLOUD-4780: Try --parallel 8
tiny-james Nov 5, 2025
374943b
TCLOUD-4780: Try --parallel 15
tiny-james Nov 5, 2025
c422864
TCLOUD-4780: Try --parallel 12
tiny-james Nov 5, 2025
ec76654
TCLOUD-4780: Try --parallel 11
tiny-james Nov 5, 2025
c2e3575
TCLOUD-4780: Try --parallel 9
tiny-james Nov 5, 2025
6e4abdd
TCLOUD-4780: Try --parallel 10 again
tiny-james Nov 5, 2025
0d5d153
TCLOUD-4780: Try --parallel 4
tiny-james Nov 5, 2025
3616f83
TCLOUD-4780: Try --parallel 8 again
tiny-james Nov 5, 2025
e5dfdb8
TCLOUD-4780: Try --parallel 6
tiny-james Nov 5, 2025
217c872
TCLOUD-4780: Try --parallel 7
tiny-james Nov 5, 2025
36b3fe4
TCLOUD-4780: Try --parallel 5 again
tiny-james Nov 5, 2025
44b6dbc
TCLOUD-4780: Move the generation of redirects to an action
tiny-james Nov 10, 2025
14a88e3
TCLOUD-4780: Try using a tag to reference the action
tiny-james Nov 10, 2025
e94a692
TCLOUD-4780: Maybe enable debug logs
tiny-james Nov 10, 2025
94464f7
TCLOUD-4780: Fix calculation of prefix
tiny-james Nov 10, 2025
7aeb001
TCLOUD-4780: Try referring to env vars just by their name
tiny-james Nov 10, 2025
91f1cef
TCLOUD-4780: Try prefixing env vars with "env."
tiny-james Nov 10, 2025
6dd03bf
TCLOUD-4780: Change AWS region
tiny-james Nov 10, 2025
d3c0b04
TCLOUD-4780: Fix creation of pointer file
tiny-james Nov 10, 2025
caefc93
TCLOUD-4780: Try loading redirects from a URL
tiny-james Nov 10, 2025
6ba5536
TCLOUD-4780: Revert to using local file path for redirects
tiny-james Nov 10, 2025
f700f81
TCLOUD-4780: Use v1.0 of the tinymce-docs-generate-redirects-action
tiny-james Nov 19, 2025
ebbe949
TCLOUD-4780: Remove out of date comments
tiny-james Nov 19, 2025
5ba3836
TCLOUD-4780: Update assumed role
tiny-james Nov 19, 2025
6d5df99
TCLOUD-4780: Fix codeql's complaint about no Javascript
tiny-james Nov 19, 2025
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
76 changes: 76 additions & 0 deletions .github/workflows/preview_create.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: Preview Create/Update

on:
pull_request:
types:
- opened
- reopened
- synchronize


# Need ID token write permission to use OIDC
permissions:
id-token: write

env:
PR: pr-${{ github.event.number }}
RUN: run-${{ github.run_number }}-${{ github.run_attempt }}

jobs:

build:
name: Update Docs Preview

runs-on: ubuntu-latest

defaults:
run:
shell: bash

steps:
- name: Checkout branch
uses: actions/checkout@v5

- name: Setup Node.js
uses: actions/setup-node@v5
with:
cache: 'yarn'
node-version: 24

- name: Install dependencies
run: yarn install

- name: Build Website
run: yarn antora ./antora-playbook.yml

- name: Rename site folder to docs
run: |
mv ./build/site ./build/docs

- name: Rename sitemap.xml to antora-sitemap.xml
run: |
mv ./build/docs/sitemap.xml ./build/docs/antora-sitemap.xml

- name: configure aws credentials
uses: aws-actions/configure-aws-credentials@v5.0.0
with:
role-to-assume: arn:aws:iam::327995277200:role/staging-tinymce-docs-update
role-session-name: tinymce-docs-update
aws-region: us-east-1

- name: Upload website preview to S3
run: |
aws s3 sync ./build s3://tiny-cloud-antora-docs-preview/${PR}/${RUN}

- name: Create redirects on S3
uses: tinymce/tinymce-docs-generate-redirects-action@v1.0
with:
build: ./build/
redirects: ./redirects.json
bucket: tiny-cloud-antora-docs-preview
prefix: ${{ env.PR }}/${{ env.RUN }}
parallel: 10

- name: Update pointer to current run output
run: |
aws s3api put-object --bucket tiny-cloud-antora-docs-preview --key ${PR}/index.html --body .github/workflows/resources/empty.html --content-type text/html --metadata pointer=${RUN}
44 changes: 44 additions & 0 deletions .github/workflows/preview_delete.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Preview Delete

on:
pull_request:
types:
- closed

# Need ID token write permission to use OIDC
permissions:
id-token: write

env:
PR: pr-${{ github.event.number }}

jobs:
cleanup:
name: Cleanup Docs Preview

runs-on: ubuntu-latest

defaults:
run:
shell: bash

steps:
- name: Checkout branch
uses: actions/checkout@v5

- name: Setup Node.js
uses: actions/setup-node@v5
with:
cache: 'yarn'
node-version: 24

- name: configure aws credentials
uses: aws-actions/configure-aws-credentials@v5.0.0
with:
role-to-assume: arn:aws:iam::327995277200:role/staging-docs-preview-update
role-session-name: docs-preview-delete
aws-region: us-east-2

- name: Remove website preview from S3
run: |
aws s3 rm s3://tiny-cloud-antora-docs-preview/${PR}
1 change: 1 addition & 0 deletions .github/workflows/resources/empty.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<!doctype html><title>?</title>
2 changes: 2 additions & 0 deletions .github/workflows/resources/unused.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// Give CodeQL something to scan so it doesn't complain there is no Javascript...
console.log('Hello world');
Loading
Loading