Skip to content

Commit 4649c9d

Browse files
authored
DOC-2324: Add workflows for development on 5 docs branch (#3219)
* DOC-2324: Testing development workflows * DOC-2324: Fix PR template (unused)
1 parent f09df7f commit 4649c9d

File tree

3 files changed

+116
-10
lines changed

3 files changed

+116
-10
lines changed

.github/pull_request_template.md

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
1-
Related Ticket:
1+
Ticket: DOC-<num>
22

3-
Description of Changes:
4-
* Placeholder text
3+
Site: [DOC-<num> site](http://docs-<hotfix/feature>-5-doc-<num>.staging.tiny.cloud/docs/tinymce/5/)
4+
5+
Changes:
6+
* <placeholder-text>
57

68
Pre-checks:
7-
- [ ] Branch prefixed with `feature/` or `hotfix/`
8-
- [ ] `_data/nav.yml` has been updated (if applicable)
9-
- [ ] Files has been included where required (if applicable)
10-
- [ ] Files removed have been deleted, not just excluded from the build (if applicable)
11-
- [ ] (New product features only) Release Note added
9+
- [ ] Branch prefixed with `feature/5/` or `hotfix/5/`
10+
- [ ] `modules/ROOT/nav.adoc` has been updated `(if applicable)`
11+
- [ ] Files has been included where required `(if applicable)`
12+
- [ ] Files removed have been deleted, not just excluded from the build `(if applicable)`
13+
- [ ] Files added for `New product features`, and included a `release note` entry.
1214

1315
Review:
14-
- [ ] Documentation Team Lead has reviewed
15-
- [ ] Product Manager has reviewed
16+
- [ ] Documentation Team Lead has reviewed

.github/workflows/codeql.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: "CodeQL"
2+
3+
on:
4+
push:
5+
branches: [ "feature/**", "hotfix/**", "tinymce/**" ]
6+
pull_request:
7+
branches: [ "tinymce/**" ]
8+
## Add schedule if needed
9+
# schedule:
10+
# - cron: "17 23 * * 5"
11+
12+
jobs:
13+
analyze:
14+
name: Analyze
15+
runs-on: ubuntu-latest
16+
permissions:
17+
actions: read
18+
contents: read
19+
security-events: write
20+
21+
strategy:
22+
fail-fast: false
23+
matrix:
24+
language: [ javascript ]
25+
26+
steps:
27+
- name: Checkout
28+
uses: actions/checkout@v3
29+
30+
- name: Initialize CodeQL
31+
uses: github/codeql-action/init@v2
32+
with:
33+
languages: ${{ matrix.language }}
34+
queries: +security-and-quality
35+
36+
- name: Autobuild
37+
uses: github/codeql-action/autobuild@v2
38+
39+
- name: Perform CodeQL Analysis
40+
uses: github/codeql-action/analyze@v2
41+
with:
42+
category: "/language:${{ matrix.language }}"
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Develop 5 Docs
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
paths:
7+
- '**'
8+
branches:
9+
- 'feature/5**'
10+
- 'hotfix/5**'
11+
12+
jobs:
13+
build:
14+
name: Build Docs and Deploy
15+
runs-on: ubuntu-22.04
16+
17+
strategy:
18+
matrix:
19+
node-version: [21]
20+
21+
steps:
22+
- uses: actions/checkout@v1
23+
24+
- name: Use Node.js
25+
uses: actions/setup-node@v2
26+
with:
27+
cache: 'yarn'
28+
node-version: ${{ matrix.node-version }}
29+
30+
- name: (Develop 5 Docs) Install dependencies
31+
run: yarn install
32+
33+
- name: (Develop 5 Docs) Build API References
34+
run: yarn build
35+
36+
- name: (Develop 5 Docs) Build Website
37+
run: yarn antora ./antora-playbook.yml
38+
39+
- name: (deploy) Prepare for branch deployments
40+
shell: bash
41+
run: |
42+
printf "User-agent: * \nDisallow: /\n" > ./build/site/robots.txt
43+
S3_BUCKET=$(node -e 'console.log(`s3://docs-${process.env.GITHUB_REF.replace("refs/heads/","").replace(/[/\s]/g, "-").replace(/[^0-9a-zA-Z-]/g, "").replace(/-$/g, "").toLowerCase()}.staging.tiny.cloud`)')
44+
printf "S3_BUCKET: ${S3_BUCKET} (${#S3_BUCKET})\n"
45+
46+
if [ ${#S3_BUCKET} -lt 3 ]
47+
then
48+
echo "WARNING! S3_BUCKET name is too short"
49+
fi
50+
51+
if [ ${#S3_BUCKET} -gt 63 ]
52+
then
53+
echo "WARNING! S3_BUCKET name is too long"
54+
fi
55+
56+
echo $S3_BUCKET > S3_BUCKET
57+
58+
- name: (deploy) Upload website to S3
59+
run: aws s3 sync --acl=public-read --delete ./build/site $(cat S3_BUCKET)/docs
60+
env:
61+
AWS_ACCESS_KEY_ID: ${{ secrets.STAGING_AWS_ACCESS_KEY_ID }}
62+
AWS_SECRET_ACCESS_KEY: ${{ secrets.STAGING_AWS_SECRET_ACCESS_KEY }}
63+
AWS_EC2_METADATA_DISABLED: true

0 commit comments

Comments
 (0)