Skip to content

Commit b08eb8d

Browse files
authored
DOC-2324: Add development workflow (#3221)
1 parent 72baba8 commit b08eb8d

File tree

2 files changed

+61
-2
lines changed

2 files changed

+61
-2
lines changed

.github/workflows/codeql.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: "CodeQL"
22

33
on:
44
push:
5-
branches: [ "feature/6/**", "hotfix/6/**", "6" ]
5+
branches: [ "feature/**", "hotfix/**", "tinymce/**" ]
66
pull_request:
7-
branches: [ "6" ]
7+
branches: [ "tinymce/**" ]
88
## Add schedule if needed
99
# schedule:
1010
# - cron: "17 23 * * 5"
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Develop 6 Docs
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
paths:
7+
- '**'
8+
branches:
9+
- 'feature/6**'
10+
- 'hotfix/6**'
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 6 Docs) Install dependencies
31+
run: yarn install
32+
33+
- name: (Develop 6 Docs) Build API References
34+
run: yarn build
35+
36+
- name: (Develop 6 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+
if [ ${#S3_BUCKET} -lt 3 ]
46+
then
47+
echo "WARNING! S3_BUCKET name is too short"
48+
fi
49+
if [ ${#S3_BUCKET} -gt 63 ]
50+
then
51+
echo "WARNING! S3_BUCKET name is too long"
52+
fi
53+
echo $S3_BUCKET > S3_BUCKET
54+
- name: (deploy) Upload website to S3
55+
run: aws s3 sync --acl=public-read --delete ./build/site $(cat S3_BUCKET)/docs
56+
env:
57+
AWS_ACCESS_KEY_ID: ${{ secrets.STAGING_AWS_ACCESS_KEY_ID }}
58+
AWS_SECRET_ACCESS_KEY: ${{ secrets.STAGING_AWS_SECRET_ACCESS_KEY }}
59+
AWS_EC2_METADATA_DISABLED: true

0 commit comments

Comments
 (0)