Files
tinymce-docs-4x/.github/workflows/feature_4_legacy_docs.yml
T

69 lines
1.7 KiB
YAML

name: Develop > Legacy Tiny 4 Docs
on:
workflow_dispatch:
push:
paths:
- '**'
branches:
- 'hotfix/**'
- 'feature/**'
env:
JEKYLL_ENV: production
jobs:
build:
name: Build Docs and Deploy
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v2
with:
node-version: 14
- uses: ruby/setup-ruby@v1
env:
BUNDLE_DEPLOYMENT: true
with:
ruby-version: 2.6
bundler-cache: true
- name: (Feature - Legacy Docs 4) Install moxiedoc
run: npm i -g ephox/moxiedoc#feature/tinymcenext
- name: (Feature - Legacy Docs 4) Build API References
run: _scripts/api-reference.sh
- name: (Feature - Legacy Docs 4) Build Website
run: _scripts/build.sh
- name: (deploy) Prepare for branch deployments
shell: bash
run: |
S3_BUCKET=$(node -e 'console.log(`s3://docs-v4-${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) Prepare files
run: _scripts/deploy-branch.sh
- name: (deploy) Upload website to S3
run: aws s3 sync --acl=public-read --delete ./_site $(cat S3_BUCKET)/docs-4x
env:
AWS_ACCESS_KEY_ID: ${{ secrets.STAGING_AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.STAGING_AWS_SECRET_ACCESS_KEY }}