DOC-1640: Swap to using GitHub actions to deploy the site (#115)
This commit is contained in:
@@ -0,0 +1,68 @@
|
||||
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 }}
|
||||
@@ -0,0 +1,70 @@
|
||||
name: Release > Legacy Tiny 4 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 4) Install moxiedoc
|
||||
run: npm i -g ephox/moxiedoc#feature/tinymcenext
|
||||
|
||||
- name: (Release - Legacy Docs 4) Build API References
|
||||
run: _scripts/api-reference.sh
|
||||
|
||||
- name: (Release - Legacy Docs 4) Build Website
|
||||
run: _scripts/build.sh
|
||||
|
||||
- name: (deploy) Prepare Staging files
|
||||
run: _scripts/deploy-staging.sh
|
||||
|
||||
- name: (deploy) Upload to Staging S3
|
||||
run: aws s3 sync --acl=public-read --delete ./_site s3://tiny-cloud-docs-v4-staging/docs-4x
|
||||
env:
|
||||
AWS_ACCESS_KEY_ID: ${{ secrets.STAGING_AWS_ACCESS_KEY_ID }}
|
||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.STAGING_AWS_SECRET_ACCESS_KEY }}
|
||||
|
||||
- name: (deploy) Invalidate Staging Cache
|
||||
run: aws cloudfront create-invalidation --distribution-id E7DUUPEI08HNW --paths "/docs-4x/*"
|
||||
env:
|
||||
AWS_ACCESS_KEY_ID: ${{ secrets.STAGING_AWS_ACCESS_KEY_ID }}
|
||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.STAGING_AWS_SECRET_ACCESS_KEY }}
|
||||
|
||||
- name: (deploy) Prepare Production files
|
||||
run: _scripts/deploy-production.sh
|
||||
|
||||
- name: (deploy) Upload to Production S3
|
||||
run: aws s3 sync --acl=public-read --delete ./_site s3://tiny-cloud-docs-v4-production/docs-4x
|
||||
env:
|
||||
AWS_ACCESS_KEY_ID: ${{ secrets.PRODUCTION_AWS_ACCESS_KEY_ID }}
|
||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.PRODUCTION_AWS_SECRET_ACCESS_KEY }}
|
||||
|
||||
- name: (deploy) Invalidate Production Cache
|
||||
run: aws cloudfront create-invalidation --distribution-id E3LFU502SQ5UR --paths "/docs-4x/*"
|
||||
env:
|
||||
AWS_ACCESS_KEY_ID: ${{ secrets.PRODUCTION_AWS_ACCESS_KEY_ID }}
|
||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.PRODUCTION_AWS_SECRET_ACCESS_KEY }}
|
||||
@@ -24,6 +24,7 @@ exclude:
|
||||
- node_modules
|
||||
- .idea
|
||||
- .git
|
||||
- .github
|
||||
|
||||
markdown: redcarpet
|
||||
|
||||
|
||||
@@ -4,6 +4,10 @@ mkdir -p ./_site/css
|
||||
mkdir -p ./_site/scripts
|
||||
mkdir -p ./_site/fonts
|
||||
|
||||
if [ -f ./_essentials/robots.txt ]; then
|
||||
rm ./_essentials/robots.txt
|
||||
fi
|
||||
|
||||
curl -o ./_site/css/common.min.css https://www.tiny.cloud/css/common.min.css -L
|
||||
curl -o ./_site/css/docs.min.css https://www.tiny.cloud/css/docs.min.css -L
|
||||
curl -o ./_site/scripts/docs.min.js https://www.tiny.cloud/scripts/docs.min.js -L
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
[1mdiff --git a/_includes/configuration/visual.md b/_includes/configuration/visual.md[m
|
||||
[1mindex 3e79790..ed53534 100644[m
|
||||
[1m--- a/_includes/configuration/visual.md[m
|
||||
[1m+++ b/_includes/configuration/visual.md[m
|
||||
[36m@@ -1,6 +1,10 @@[m
|
||||
## visual[m
|
||||
[m
|
||||
[31m-This true/false option gives you the ability to turn on/off the visual aid for tables with no borders. If the border of a table is set to `0`, then TinyMCE adds a dotted line around the table by default.[m
|
||||
[32m+[m[32mThis true/false option gives you the ability to enable or disable the `visual` aid.[m
|
||||
[32m+[m
|
||||
[32m+[m[32mThis setting also allows `visual` aid to override the `Menu` settings. For instance, you can enable or disable `visual` aid even if the `Menu` is set to `False`.[m
|
||||
[32m+[m
|
||||
[32m+[m[32mIf the border of a table is set to `0`, then TinyMCE adds a dotted line around the table by default.[m
|
||||
[m
|
||||
**Type:** `Boolean`[m
|
||||
[m
|
||||
[36m@@ -12,7 +16,7 @@[m [mThis true/false option gives you the ability to turn on/off the visual aid for t[m
|
||||
[m
|
||||
```js[m
|
||||
tinymce.init({[m
|
||||
[31m- selector: 'textarea', // change this value according to your HRML[m
|
||||
[32m+[m[32m selector: 'textarea', // change this value according to your HTML[m
|
||||
visual: false[m
|
||||
});[m
|
||||
```[m
|
||||
-68
@@ -1,68 +0,0 @@
|
||||
box:
|
||||
id: jointiny/tiny-cloud-docs-build
|
||||
username: $DOCKER_USER
|
||||
password: $DOCKER_PASSWORD
|
||||
tag: latest
|
||||
no-response-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
|
||||
|
||||
invalidate_cache:
|
||||
steps:
|
||||
- script:
|
||||
code: aws cloudfront create-invalidation --distribution-id $CLOUDFRONT_DISTRIBUTION_ID --paths "/docs-4x/*"
|
||||
|
||||
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-v4-${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-4x/
|
||||
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-4x/
|
||||
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-4x/
|
||||
source-dir: $S3_SOURCE
|
||||
opts: --delete-removed
|
||||
Reference in New Issue
Block a user