-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (46 loc) · 1.8 KB
/
dev_build-react-app.yml
File metadata and controls
47 lines (46 loc) · 1.8 KB
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
name: (DEV) build react app and reload nginx
on:
push:
branches:
- develop
paths:
- 'client/src/**'
- 'client/public/**'
jobs:
build-and-deploy-react-app:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16.14.1
- name: Install Dependencies
run: cd client && npm install --production
- name: Build
run: cd client && npm run build
env:
REACT_APP_GOOGLE_ANALYTICS_TRAKING_ID: ${{ secrets.DEV_REACT_APP_GOOGLE_ANALYTICS_TRAKING_ID }}
REACT_APP_API_KEY: ${{ secrets.DEV_REACT_APP_API_KEY }}
REACT_APP_AUTH_DOMAIN: ${{ secrets.DEV_REACT_APP_AUTH_DOMAIN }}
REACT_APP_PROJECT_ID: ${{ secrets.DEV_REACT_APP_PROJECT_ID }}
REACT_APP_STORAGE_BUCKET: ${{ secrets.DEV_REACT_APP_STORAGE_BUCKET }}
REACT_APP_MESSAGIN_ID: ${{ secrets.DEV_REACT_APP_MESSAGIN_ID }}
REACT_APP_APP_ID: ${{ secrets.DEV_REACT_APP_APP_ID }}
REACT_APP_MEASUREMENT_ID: ${{ secrets.DEV_REACT_APP_MEASUREMENT_ID }}
- name: Package Application
run: cd client && tar -czvf build.tar.gz build
- name: scp to EC2
uses: appleboy/scp-action@master
with:
host: ${{ secrets.DEV_EC2_IP_ADDRESS }}
username: ${{ secrets.DEV_EC2_USER }}
key: ${{ secrets.DEV_EC2_PRIVATE_KEY }}
source: client/build.tar.gz
target: ~/project/application/
- name: execute shell script
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.DEV_EC2_IP_ADDRESS }}
username: ${{ secrets.DEV_EC2_USER }}
key: ${{ secrets.DEV_EC2_PRIVATE_KEY }}
script: "cd /home/ubuntu/project/application; ./scripts/dev-server/deploy-build-file.sh"