-
Notifications
You must be signed in to change notification settings - Fork 17
85 lines (75 loc) · 3.69 KB
/
all-dev-rig.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
name: ALL rig dev Deployment
on:
push:
branches:
- all-automation
jobs:
deploy:
runs-on: ubuntu-latest
environment: all-dev-rig
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '16'
- name: Install AWS CLI
run: |
sudo DEBIAN_FRONTEND=noninteractive apt-get update
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y awscli
- name: Configure AWS credentials
run: |
aws configure set aws_access_key_id ${{ secrets.AWS_ACCESS_KEY_ID }}
aws configure set aws_secret_access_key ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws configure set default.region ${{ secrets.AWS_REGION }}
- name: Build and Package Application
env:
SKIP_PREFLIGHT_CHECK: ${{ env.SKIP_PREFLIGHT_CHECK }}
REACT_APP_MODE: ${{ env.REACT_APP_MODE }}
REACT_APP_authToken: ${{ env.REACT_APP_authToken }}
REACT_APP_PID: ${{ env.REACT_APP_PID }}
REACT_APP_UID: ${{ env.REACT_APP_UID }}
REACT_APP_ID: ${{ env.REACT_APP_ID }}
REACT_APP_VER: ${{ env.REACT_APP_VER }}
REACT_APP_TIMEDIFF: ${{ env.REACT_APP_TIMEDIFF }}
REACT_APP_HOST: ${{ env.REACT_APP_HOST }}
REACT_APP_ENDPOINT: ${{ env.REACT_APP_ENDPOINT }}
REACT_APP_APISLUG: ${{ env.REACT_APP_APISLUG }}
REACT_APP_CHANNEL: ${{ env.REACT_APP_CHANNEL }}
REACT_APP_ENV: ${{ env.REACT_APP_ENV }}
REACT_APP_BATCHSIZE: ${{ env.REACT_APP_BATCHSIZE }}
REACT_APP_CONTENT_SIZE: ${{ env.REACT_APP_CONTENT_SIZE }}
REACT_APP_LANGUAGE: ${{ env.REACT_APP_LANGUAGE }}
REACT_APP_TELEMETRY_MODE: ${{ env.REACT_APP_TELEMETRY_MODE }}
REACT_APP_VIRTUAL_ID_HOST: ${{ env.REACT_APP_VIRTUAL_ID_HOST }}
REACT_APP_LEARNER_AI_ORCHESTRATION_HOST: ${{ env.REACT_APP_LEARNER_AI_ORCHESTRATION_HOST }}
REACT_APP_LEARNER_AI_APP_HOST: ${{ env.REACT_APP_LEARNER_AI_APP_HOST }}
REACT_APP_CONTENT_SERVICE_APP_HOST: ${{ env.REACT_APP_CONTENT_SERVICE_APP_HOST }}
REACT_APP_CAPTURE_AUDIO: ${{ env.REACT_APP_CAPTURE_AUDIO }}
REACT_APP_AWS_S3_BUCKET_NAME: ${{ env.REACT_APP_AWS_S3_BUCKET_NAME }}
REACT_APP_AWS_S3_BUCKET_URL: ${{ env.REACT_APP_AWS_S3_BUCKET_URL }}
REACT_APP_AWS_S3_REGION: ${{ env.REACT_APP_AWS_S3_REGION }}
REACT_APP_AWS_S3_BUCKET_CONTENT_URL: ${{ env.REACT_APP_AWS_S3_BUCKET_CONTENT_URL }}
REACT_APP_MIN_DECIBELS: ${{ env.REACT_APP_MIN_DECIBELS }}
REACT_APP_IS_AUDIOPREPROCESSING: ${{ env.REACT_APP_IS_AUDIOPREPROCESSING }}
REACT_APP_POST_LEARNER_PROGRESS: ${{ env.REACT_APP_POST_LEARNER_PROGRESS }}
REACT_APP_IS_APP_IFRAME: ${{ env.REACT_APP_IS_APP_IFRAME }}
REACT_APP_IS_APP_TEST_RIG: ${{ env.REACT_APP_IS_APP_TEST_RIG }}
REACT_APP_IS_APP_LANGUAGES: ${{ env.REACT_APP_IS_APP_LANGUAGES }}
run: npm run build
- name: Deploy to S3 Bucket
run: aws s3 sync ./build s3://sballappliance/all-automation/
- name: Debug Environment Variables
run: |
echo "REACT_APP_AWS_S3_BUCKET_NAME: $REACT_APP_AWS_S3_BUCKET_NAME"
echo "AWS_REGION: $AWS_REGION"
echo "secrate": ${{ env.REACT_APP_AWS_S3_BUCKET_NAME }}
- name: Cloudfront Invalidation
uses: chetan/invalidate-cloudfront-action@master
env:
DISTRIBUTION: ${{ secrets.AWS_DISTRIBUTION }}
PATHS: '/*'
AWS_REGION: ${{ secrets.AWS_REGION }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}