-
Notifications
You must be signed in to change notification settings - Fork 220
TCLOUD-4780: Add workflows to create and delete previews for TinyMCE 8 branches #3924
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+122
−1
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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: 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} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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-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} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| <!doctype html><title>?</title> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.