forked from ir-engine/ir-engine
-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (55 loc) Β· 1.91 KB
/
ir-engine-deploy.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
name: Deploy IR Engine
on:
push:
branches: [dev, int, stg]
paths-ignore:
- '**/*.md'
- '.*ignore'
workflow_dispatch:
inputs:
environment:
description: Evironment to Deploy
required: true
type: choice
options:
- dev
- int
- stg
env:
TARGET_BRANCH_NAME: ${{ github.base_ref || github.ref_name }}
jobs:
remote-dispatch-deploy:
runs-on: ubuntu-latest
steps:
- name: Check out repository with limited history
uses: actions/checkout@v3
with:
fetch-depth: 2
- name: Send Remote Dispatch to Deploy IR-Engine
run: |
curl -H "Authorization: token ${{ secrets.IR_ORG_ACCESS_TOKEN }}" \
-H 'Accept: application/vnd.github.everest-preview+json' \
${{ secrets.IR_ENGINE_OPS_API_URL }} \
-d '{"event_type": "deploy-ir-engine", "client_payload": {"environment": "${{ env.TARGET_BRANCH_NAME }}"}}'
- name: Detect changes in packages/ui
id: check_changes
run: |
echo "Checking for changes in packages/ui directory..."
if git diff --name-only HEAD~1 HEAD | grep -q 'packages/ui/'; then
echo "UI package changes detected."
echo "ui_package_changed=true" >> $GITHUB_ENV
else
echo "No changes detected in UI package."
echo "ui_package_changed=false" >> $GITHUB_ENV
fi
- name: Deploy Storybook
if: env.TARGET_BRANCH_NAME == 'dev' && env.ui_package_changed == 'true'
run: |
echo "Deploying storybook"
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.STORYBOOK_DOCS_PAT }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/ir-engine/storybook-docs/dispatches \
-d '{"event_type":"push"}'