Skip to content

Child repository triggered doc build #943

Child repository triggered doc build

Child repository triggered doc build #943

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: 14
jobs:
dead-links:
name: Check the dead-links on the repo
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- 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
- uses: actions/[email protected]
with:
node-version: ${{ env.NODE_VERSION }}
- 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:
- uses: actions/checkout@v2
- uses: actions/[email protected]
with:
node-version: ${{ env.NODE_VERSION }}
- 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 }}"
- 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 }}
- 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 }}