Skip to content
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

DOC-2324: Add workflows for development on 7 docs branch #3220

Merged
merged 6 commits into from
Apr 15, 2024
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
4 changes: 2 additions & 2 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: "CodeQL"

on:
push:
branches: [ "feature/**", "hotfix/**", "staging/**", "release/**" ]
branches: [ "feature/**", "hotfix/**", "tinymce/**" ]
pull_request:
branches: [ "staging/**", "release/**" ]
branches: [ "tinymce/**" ]
## Add schedule if needed
# schedule:
# - cron: "17 23 * * 5"
Expand Down
60 changes: 60 additions & 0 deletions .github/workflows/develop_7_docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Develop 7 Docs

on:
workflow_dispatch:
push:
paths:
- '**'
branches:
- 'feature/7**'
- 'hotfix/7**'

jobs:
build:
name: Build Docs and Deploy
runs-on: ubuntu-22.04

strategy:
matrix:
node-version: [21]

steps:
- uses: actions/checkout@v1

- name: Use Node.js
uses: actions/setup-node@v2
with:
cache: 'yarn'
node-version: ${{ matrix.node-version }}

- name: (Develop 7 Docs) Install dependencies
run: yarn install

- name: (Develop 7 Docs) Build API References
run: yarn build

- name: (Develop 7 Docs) Build Website
run: yarn antora ./antora-playbook.yml

- name: (deploy) Prepare for branch deployments
shell: bash
run: |
printf "User-agent: * \nDisallow: /\n" > ./build/site/robots.txt
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`)')
printf "S3_BUCKET: ${S3_BUCKET} (${#S3_BUCKET})\n"
if [ ${#S3_BUCKET} -lt 3 ]
then
echo "WARNING! S3_BUCKET name is too short"
fi
if [ ${#S3_BUCKET} -gt 63 ]
then
echo "WARNING! S3_BUCKET name is too long"
fi
echo $S3_BUCKET > S3_BUCKET

- name: (deploy) Upload website to S3
run: aws s3 sync --acl=public-read --delete ./build/site $(cat S3_BUCKET)/docs
env:
AWS_ACCESS_KEY_ID: ${{ secrets.STAGING_AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.STAGING_AWS_SECRET_ACCESS_KEY }}
AWS_EC2_METADATA_DISABLED: true
Loading