Skip to content

Child repository triggered doc build #1257

Child repository triggered doc build

Child repository triggered doc build #1257

name: Child repository triggered doc build
on:
workflow_dispatch:
inputs:
repo_name:
description: 'The name of the repository that triggered the workflow'
required: true
branch:
description: 'The branch of the child repo to deploy'
required: false
version:
description: 'The version of the product in the child repo'
required: true
env:
NODE_VERSION: 20
jobs:
dead-links:
name: Check the dead-links on the repo
runs-on: ubuntu-20.04
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Output event inputs for debug
run: echo "Repo ${{ github.event.inputs.repo_name }} triggered this workflow from branch ${{ github.event.inputs.branch }} v${{ github.event.inputs.version }}"
- name: Install SSH key
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.SSH_KEY }}
name: id_rsa
known_hosts: unnecessary
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'npm'
# Dead links does not work because of private template
# From iot platform
# - name: Check dead links
# uses: ./.github/actions/dead-links
# with:
# repo_name: ${{ github.event.inputs.repo_name }}
# repo_version: ${{ github.event.inputs.version }}
# repo_branch: ${{ github.event.inputs.branch }}
deploy:
name: Deploy the repo
runs-on: ubuntu-20.04
needs: [dead-links]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'npm'
- name: Install SSH key
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.SSH_KEY }}
name: id_rsa
known_hosts: unnecessary
- name: Output event inputs for debug
run: echo "Repo ${{ github.event.inputs.repo_name }} triggered this workflow from branch ${{ github.event.inputs.branch }}"
- name: Deploy repository for production
uses: ./.github/actions/deploy_repo
if: ${{ github.ref == 'refs/heads/master' }}
with:
repo_name: ${{ github.event.inputs.repo_name }}
repo_version: ${{ github.event.inputs.version }}
repo_branch: ${{ github.event.inputs.branch }}
REGION: us-west-2
S3_BUCKET: docs.kuzzle.io
CLOUDFRONT_ID: E3D6RP0POLCJMM
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
- name: Deploy repository for staging
uses: ./.github/actions/deploy_repo
if: ${{ github.ref != 'refs/heads/master' }}
with:
repo_name: ${{ github.event.inputs.repo_name }}
repo_version: ${{ github.event.inputs.version }}
repo_branch: ${{ github.event.inputs.branch }}
REGION: us-west-2
S3_BUCKET: docs-next.kuzzle.io
CLOUDFRONT_ID: E2ZCCEK9GRB49U
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}