Skip to content

Commit

Permalink
[ci] Move CI to cross-repo doc build & deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
xbill82 committed Aug 6, 2021
1 parent 29c6c6d commit c635b9c
Show file tree
Hide file tree
Showing 5 changed files with 91 additions and 194 deletions.
18 changes: 0 additions & 18 deletions .github/actions/dead-links/action.yml

This file was deleted.

54 changes: 0 additions & 54 deletions .github/actions/deploy-doc/action.yml

This file was deleted.

45 changes: 23 additions & 22 deletions .github/workflows/pull_request.workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,6 @@ name: Pull request checks
on: [pull_request]

jobs:
# dead-links:
# name: Dead links
# runs-on: ubuntu-latest
# timeout-minutes: 30
# steps:
# - uses: actions/checkout@v2
# - name: Cache node modules
# uses: actions/cache@v2
# env:
# cache-name: cache-node-modules
# with:
# path: ~/.npm
# key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
# restore-keys: |
# ${{ runner.os }}-build-${{ env.cache-name }}-
# ${{ runner.os }}-build-
# ${{ runner.os }}-
# - uses: actions/[email protected]
# with:
# node-version: "12"
# - uses: ./.github/actions/dead-links

doc-snippets:
name: Doc Snippets
runs-on: ubuntu-latest
Expand Down Expand Up @@ -55,3 +33,26 @@ jobs:
- uses: actions/checkout@v2
- uses: cedx/setup-dart@v2
- uses: ./.github/actions/tests

doc-dead-links:
name: Check dead-links
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Extract references from context
shell: bash
id: extract-refs
run: |
echo "::set-output name=version::$(git describe --abbrev=0 --tags | cut -d. -f 1)"
echo "::set-output name=repo::$(echo $GITHUB_REPOSITORY | cut -d/ -f 2)"
echo "::set-output name=fw-branch::$(if [ $BASE_BRANCH == master ]; then echo master; else echo develop; fi)"
- uses: convictional/[email protected]
with:
owner: kuzzleio
repo: documentation
github_token: ${{ secrets.ACCESS_TOKEN_CI }}
workflow_file_name: dead_links.workflow.yml
ref: ${{ steps.extract-refs.outputs.fw-branch }}
inputs: '{"repo_name": "${{ steps.extract-refs.outputs.repo }}", "branch": "${{ github.head_ref }}", "version": "${{ steps.extract-refs.outputs.version }}"}'
84 changes: 34 additions & 50 deletions .github/workflows/push_dev.workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,30 +7,28 @@ on:
- 2-dev

jobs:
dead-links:
name: Dead links
doc-dead-links:
name: Check dead-links
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v2
- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- uses: actions/[email protected]
fetch-depth: 0
- name: Extract references from context
shell: bash
id: extract-refs
run: |
echo "::set-output name=version::$(git describe --abbrev=0 --tags | cut -d. -f 1)"
echo "::set-output name=repo::$(echo $GITHUB_REPOSITORY | cut -d/ -f 2)"
echo "::set-output name=fw-branch::$(if [ $BASE_BRANCH == master ]; then echo master; else echo develop; fi)"
- uses: convictional/[email protected]
with:
node-version: "12"
- uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.SSH_KEY }}
- uses: ./.github/actions/dead-links
owner: kuzzleio
repo: documentation
github_token: ${{ secrets.ACCESS_TOKEN_CI }}
workflow_file_name: dead_links.workflow.yml
ref: ${{ steps.extract-refs.outputs.fw-branch }}
inputs: '{"repo_name": "${{ steps.extract-refs.outputs.repo }}", "branch": "${{ github.head_ref }}", "version": "${{ steps.extract-refs.outputs.version }}"}'

doc-snippets:
name: Doc Snippets
Expand Down Expand Up @@ -63,39 +61,25 @@ jobs:
- uses: cedx/setup-dart@v2
- uses: ./.github/actions/tests

doc-dev:
name: Deployment Doc Dev
doc-deploy:
name: Deploy Doc to NEXT
runs-on: ubuntu-latest
timeout-minutes: 30
# needs: [dead-links, doc-snippets, tests]
needs: [doc-snippets, tests]
needs: [doc-snippets, tests, doc-dead-links]
steps:
- uses: actions/checkout@v2
- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- uses: actions/setup-node@v1
with:
node-version: "12"
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.9"
- uses: ./.github/actions/deploy-doc
env:
NODE_OPTIONS: "--max_old_space_size=4096"
fetch-depth: 0
- name: Extract references from context
shell: bash
id: extract-refs
run: |
echo "::set-output name=version::$(git describe --abbrev=0 --tags | cut -d. -f 1)"
echo "::set-output name=repo::$(echo $GITHUB_REPOSITORY | cut -d/ -f 2)"
- uses: convictional/[email protected]
with:
S3_BUCKET: docs-next.kuzzle.io
CLOUDFRONT_ID: E2ZCCEK9GRB49U
REGION: us-west-2
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
FRAMEWORK_BRANCH: develop
owner: kuzzleio
repo: documentation
github_token: ${{ secrets.ACCESS_TOKEN_CI }}
workflow_file_name: child_repo.workflow.yml
ref: develop
inputs: '{"repo_name": "${{ steps.extract-refs.outputs.repo }}", "branch": "${{ github.head_ref }}", "version": "${{ steps.extract-refs.outputs.version }}"}'
84 changes: 34 additions & 50 deletions .github/workflows/push_master.workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,30 +7,28 @@ on:
- 1-stable

jobs:
dead-links:
name: Dead links
doc-dead-links:
name: Check dead-links
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v2
- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- uses: actions/[email protected]
fetch-depth: 0
- name: Extract references from context
shell: bash
id: extract-refs
run: |
echo "::set-output name=version::$(git describe --abbrev=0 --tags | cut -d. -f 1)"
echo "::set-output name=repo::$(echo $GITHUB_REPOSITORY | cut -d/ -f 2)"
echo "::set-output name=fw-branch::$(if [ $BASE_BRANCH == master ]; then echo master; else echo develop; fi)"
- uses: convictional/[email protected]
with:
node-version: "12"
- uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.SSH_KEY }}
- uses: ./.github/actions/dead-links
owner: kuzzleio
repo: documentation
github_token: ${{ secrets.ACCESS_TOKEN_CI }}
workflow_file_name: dead_links.workflow.yml
ref: ${{ steps.extract-refs.outputs.fw-branch }}
inputs: '{"repo_name": "${{ steps.extract-refs.outputs.repo }}", "branch": "${{ github.head_ref }}", "version": "${{ steps.extract-refs.outputs.version }}"}'

doc-snippets:
name: Doc Snippets
Expand Down Expand Up @@ -63,42 +61,28 @@ jobs:
- uses: cedx/setup-dart@v2
- uses: ./.github/actions/tests

doc-prod:
name: Deployment Doc Prod
doc-deploy:
name: Deploy Doc to Prod
runs-on: ubuntu-latest
timeout-minutes: 30
# needs: [dead-links, doc-snippets]
needs: [doc-snippets]
needs: [doc-snippets, tests, doc-dead-links]
steps:
- uses: actions/checkout@v2
- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- uses: actions/setup-node@v1
with:
node-version: "12"
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.9"
- uses: ./.github/actions/deploy-doc
env:
NODE_OPTIONS: "--max_old_space_size=4096"
fetch-depth: 0
- name: Extract references from context
shell: bash
id: extract-refs
run: |
echo "::set-output name=version::$(git describe --abbrev=0 --tags | cut -d. -f 1)"
echo "::set-output name=repo::$(echo $GITHUB_REPOSITORY | cut -d/ -f 2)"
- uses: convictional/[email protected]
with:
FRAMEWORK_BRANCH: master
S3_BUCKET: docs.kuzzle.io
CLOUDFRONT_ID: E3D6RP0POLCJMM
REGION: us-west-2
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
owner: kuzzleio
repo: documentation
github_token: ${{ secrets.ACCESS_TOKEN_CI }}
workflow_file_name: child_repo.workflow.yml
ref: develop
inputs: '{"repo_name": "${{ steps.extract-refs.outputs.repo }}", "branch": "${{ github.head_ref }}", "version": "${{ steps.extract-refs.outputs.version }}"}'

deploy-package:
name: Publish Package
Expand Down

0 comments on commit c635b9c

Please sign in to comment.