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
2 changes: 1 addition & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Ticket: DOC-<num>

Site: [Staging branch](http://docs-<hotfix|feature>-7-doc-<num>.staging.tiny.cloud/docs/tinymce/latest/)
Site: [Staging branch](https://pr-<PR#>.tinymce-docs.iad.staging.tiny.cloud/docs/tinymce/7/)

Changes:
* <placeholder-text>
Expand Down
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/[email protected]
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/[email protected]
with:
build: ./build/
redirects: https://raw.githubusercontent.com/tinymce/tinymce-docs/refs/heads/main/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/[email protected]
with:
role-to-assume: arn:aws:iam::327995277200:role/staging-tinymce-docs-update
role-session-name: tinymce-docs-delete
aws-region: us-east-2

- name: Remove website preview from S3
run: |
aws s3 rm --recursive 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>
Loading