From a6eef91c9c549496d9438da7ffec5732ca27640a Mon Sep 17 00:00:00 2001 From: Lee Newson Date: Fri, 8 Apr 2022 06:46:39 +1000 Subject: [PATCH] DOC-1640: Setup GitHub action workflows for publishing legacy jekyll docs --- .github/workflows/feature_5_legacy_docs.yml | 67 +++++++++++++++++ .github/workflows/release_5_legacy_docs.yml | 55 ++++++++++++++ .github/workflows/staging_5_legacy_docs.yml | 55 ++++++++++++++ _config.yml | 3 + tash | 26 ------- wercker.yml | 82 --------------------- 6 files changed, 180 insertions(+), 108 deletions(-) create mode 100644 .github/workflows/feature_5_legacy_docs.yml create mode 100644 .github/workflows/release_5_legacy_docs.yml create mode 100644 .github/workflows/staging_5_legacy_docs.yml delete mode 100644 tash delete mode 100644 wercker.yml diff --git a/.github/workflows/feature_5_legacy_docs.yml b/.github/workflows/feature_5_legacy_docs.yml new file mode 100644 index 000000000..739a68d98 --- /dev/null +++ b/.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 }} diff --git a/.github/workflows/release_5_legacy_docs.yml b/.github/workflows/release_5_legacy_docs.yml new file mode 100644 index 000000000..552872861 --- /dev/null +++ b/.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 }} diff --git a/.github/workflows/staging_5_legacy_docs.yml b/.github/workflows/staging_5_legacy_docs.yml new file mode 100644 index 000000000..6dcf8ee19 --- /dev/null +++ b/.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 }} \ No newline at end of file diff --git a/_config.yml b/_config.yml index 194cbb7da..fe42799d1 100644 --- a/_config.yml +++ b/_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 diff --git a/tash b/tash deleted file mode 100644 index 9a94015da..000000000 --- a/tash +++ /dev/null @@ -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 - --- diff --git a/wercker.yml b/wercker.yml deleted file mode 100644 index 69c4c92a1..000000000 --- a/wercker.yml +++ /dev/null @@ -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