Browse Source

DOC-1640: Setup GitHub action workflows for publishing legacy jekyll docs

pull/2387/head
Lee Newson 3 years ago
committed by Lee Newson
parent
commit
a6eef91c9c
  1. 67
      .github/workflows/feature_5_legacy_docs.yml
  2. 55
      .github/workflows/release_5_legacy_docs.yml
  3. 55
      .github/workflows/staging_5_legacy_docs.yml
  4. 3
      _config.yml
  5. 26
      tash
  6. 82
      wercker.yml

67
.github/workflows/feature_5_legacy_docs.yml

@ -0,0 +1,67 @@
name: Develop > Legacy Tiny 5 Docs
on:
workflow_dispatch:
push:
paths:
- '**'
branches:
- 'feature/5/DOC-1640'
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 5) Install moxiedoc
run: npm i -g ephox/moxiedoc#feature/tinymcenext
- name: (Feature - Legacy Docs 5) Build API References
run: _scripts/api-reference.sh
- name: (Feature - Legacy Docs 5) Build Website
run: _scripts/build.sh
- name: (deploy) Prepare for branch deployments
shell: bash
run: |
S3_BUCKET=$(node -e 'console.log(`s3://docs-v5-${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
env:
AWS_ACCESS_KEY_ID: ${{ secrets.STAGING_AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.STAGING_AWS_SECRET_ACCESS_KEY }}

55
.github/workflows/release_5_legacy_docs.yml

@ -0,0 +1,55 @@
name: Release > Legacy Tiny 5 Docs
on:
workflow_dispatch:
push:
paths:
- '**'
branches:
- 'main'
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: (Release - Legacy Docs 5) Install moxiedoc
run: npm i -g ephox/moxiedoc#feature/tinymcenext
- name: (Release - Legacy Docs 5) Build API References
run: _scripts/api-reference.sh
- name: (Release - Legacy Docs 5) Build Website
run: _scripts/build.sh
- name: (deploy) Prepare files
run: _scripts/deploy-production.sh
- name: (deploy) Upload to S3
run: aws s3 sync --acl=public-read --delete ./_site s3://tiny-cloud-docs-production/docs
env:
AWS_ACCESS_KEY_ID: ${{ secrets.PRODUCTION_AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.PRODUCTION_AWS_SECRET_ACCESS_KEY }}
- name: (deploy) Invalidate Cache
run: aws cloudfront create-invalidation --distribution-id E3LFU502SQ5UR --paths "/docs/*"
env:
AWS_ACCESS_KEY_ID: ${{ secrets.PRODUCTION_AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.PRODUCTION_AWS_SECRET_ACCESS_KEY }}

55
.github/workflows/staging_5_legacy_docs.yml

@ -0,0 +1,55 @@
name: Staging > Legacy Tiny 5 Docs
on:
workflow_dispatch:
push:
paths:
- '**'
branches:
- 'develop'
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: (Staging - Legacy Docs 5) Install moxiedoc
run: npm i -g ephox/moxiedoc#feature/tinymcenext
- name: (Staging - Legacy Docs 5) Build API References
run: _scripts/api-reference.sh
- name: (Staging - Legacy Docs 5) Build Website
run: _scripts/build.sh
- name: (deploy) Prepare files
run: _scripts/deploy-staging.sh
- name: (deploy) Upload to S3
run: aws s3 sync --acl=public-read --delete ./_site s3://tiny-cloud-docs-staging/docs
env:
AWS_ACCESS_KEY_ID: ${{ secrets.STAGING_AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.STAGING_AWS_SECRET_ACCESS_KEY }}
- name: (deploy) Invalidate Cache
run: aws cloudfront create-invalidation --distribution-id E7DUUPEI08HNW --paths "/docs/*"
env:
AWS_ACCESS_KEY_ID: ${{ secrets.STAGING_AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.STAGING_AWS_SECRET_ACCESS_KEY }}

3
_config.yml

@ -102,6 +102,9 @@ exclude:
- .git
- .github
- _new_content_templates
- nixpin.nix
- shell.nix
- Makefile
# redcarpet was messing up some of the live demos
markdown: kramdown

26
tash

@ -1,26 +0,0 @@
diff --git a/_data/nav.yml b/_data/nav.yml
index d8edd8c..3f2e139 100644
--- a/_data/nav.yml
+++ b/_data/nav.yml
@@ -529,6 +529,8 @@
- url: "wordpress"

- url: "migration-from-4x"
+ pages:
+ - url: "#Themes"

- url: "release-notes"
pages:
diff --git a/migration-from-4x.md b/migration-from-4x.md
index c10a11e..8bcb65c 100644
--- a/migration-from-4x.md
+++ b/migration-from-4x.md
@@ -1,7 +1,6 @@
---
layout: default
-title: Migrating from TinyMCE 4.x to TinyMCE 5.0.
-title_nav: Migrating from 4.x
+title: Migrating from 4.x
description: Instructions for migrating from TinyMCE 4.x to TinyMCE 5.0.
keywords: migration considerations premigration pre-migration
---

82
wercker.yml

@ -1,82 +0,0 @@
box:
id: jointiny/tiny-cloud-docs-build
username: $DOCKER_USER
password: $DOCKER_PASSWORD
tag: latest
no-response-timeout: 30
command-timeout: 30
build:
steps:
- add-to-known_hosts:
hostname: github.com
- add-ssh-key:
keyname: SSH_KEY
- script:
name: install moxiedoc
code: npm i -g ephox/moxiedoc#feature/tinymcenext
- bundle-install:
deployment: true
jobs: 10
- script:
name: import tinymce api reference
code: _scripts/api-reference.sh
- script:
name: build
code: _scripts/build.sh
check_links:
box: jointiny/tiny-cloud-docs-linkchecker
steps:
- script:
name: check links
code: _scripts/check-links-staging.sh
- s3sync:
key-id: $AWS_ACCESS_KEY_ID
key-secret: $AWS_SECRET_ACCESS_KEY
bucket-url: $S3_BUCKET/docs/
source-dir: _report
delete-removed: false
invalidate_cache:
steps:
- script:
code: aws cloudfront create-invalidation --distribution-id $CLOUDFRONT_DISTRIBUTION_ID --paths "/docs/*"
deploy_branch:
steps:
- script:
name: prepare files
code: _scripts/deploy-branch.sh
- script:
name: get bucket name
code: export S3_BUCKET=$(node -e 'console.log(`s3://docs-v5-${process.env.WERCKER_GIT_BRANCH.replace(/[/\s]/g, "-").replace(/[^0-9a-zA-Z-]/g, "").replace(/-$/g, "").toLowerCase()}.staging.tiny.cloud`)')
- s3sync:
key-id: $AWS_ACCESS_KEY_ID
key-secret: $AWS_SECRET_ACCESS_KEY
bucket-url: $S3_BUCKET/docs/
source-dir: $S3_SOURCE
deploy_staging:
steps:
- script:
name: prepare files
code: _scripts/deploy-staging.sh
- s3sync:
key-id: $AWS_ACCESS_KEY_ID
key-secret: $AWS_SECRET_ACCESS_KEY
bucket-url: $S3_BUCKET/docs/
source-dir: $S3_SOURCE
opts: --delete-removed
deploy_production:
steps:
- script:
name: prepare files
code: _scripts/deploy-production.sh
- s3sync:
key-id: $AWS_ACCESS_KEY_ID
key-secret: $AWS_SECRET_ACCESS_KEY
bucket-url: $S3_BUCKET/docs/
source-dir: $S3_SOURCE
opts: --delete-removed
Loading…
Cancel
Save