-
Notifications
You must be signed in to change notification settings - Fork 5
98 lines (85 loc) · 3.2 KB
/
child_repo.workflow.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
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: 16
jobs:
dead-links:
name: Check the dead-links on the repo
runs-on: ubuntu-20.04
steps:
- name: Checkout repository
uses: actions/checkout@v3
- 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: Setup Node JS
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
# 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@v3
- name: Setup Node JS
uses: actions/setup-node@v3
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 }}"
- 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 }}