-
Notifications
You must be signed in to change notification settings - Fork 160
72 lines (70 loc) · 2.66 KB
/
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
name: Deploy Components Demo App Workflow
on:
push:
branches:
- main
- 'release-**.x'
jobs:
deploy:
name: Deploy Demo App and Storybook
runs-on: ubuntu-latest
env:
AWS_DEFAULT_REGION: us-east-1
AWS_DEFAULT_OUTPUT: text
AWS_ACCESS_KEY_ID: ${{secrets.AWS_ACCESS_KEY}}
AWS_SECRET_ACCESS_KEY: ${{secrets.AWS_SECRET_ACCESS_KEY}}
steps:
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1
- name: Checkout Package
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Install SAM CLI
run: scripts/github-action-awscli-installation
- name: Setup Node environment
uses: actions/setup-node@v1
with:
node-version: 20
- name: Get branch name
id: branch_name
run: |
branch=${{github.ref}}
branch=${branch#refs/heads/}
echo $branch
echo ::set-output name=branch_name::$branch
- name: Checkout amazon-chime-sdk repo
uses: actions/checkout@v2
with:
repository: 'aws-samples/amazon-chime-sdk'
path: amazon-chime-sdk
ref: ${{steps.branch_name.outputs.branch_name}}
- name: Install latest version of React library and JS SDK in meeting demo
run: |
npm install
node ./scripts/update-sdk-version.js
- name: Deploy the Serverless Demo App
if: ${{ steps.branch_name.outputs.branch_name == 'main' }}
run: |
cd $GITHUB_WORKSPACE/amazon-chime-sdk/apps/meeting/serverless
node ./deploy.js -r us-east-1 -b chime-sdk-components-demo-canary -s chime-sdk-components-demo-canary -l
- name: Deploy the Serverless Demo App for Previous Major Version
if: ${{ steps.branch_name.outputs.branch_name != 'main' }}
run: |
cd $GITHUB_WORKSPACE/amazon-chime-sdk/apps/meeting/serverless
node ./deploy.js -r us-east-1 -b chime-sdk-components-demo-canary-prev -s chime-sdk-components-demo-canary-prev -l
- name: Check if need to deploy storybook
id: need_deploy
run: |
result=$(.github/script/need-deploy-storybook.js)
echo $result
echo ::set-output name=need_deploy::$result
- name: Publish Storybook Documentation
if: startsWith(steps.need_deploy.outputs.need_deploy, 'Deploy storybook')
run: npm run deploy-storybook -- --ci
env:
GH_TOKEN: chime-sdk-js-bot:${{ secrets.GITHUBPAGES}}