-
Notifications
You must be signed in to change notification settings - Fork 77
51 lines (40 loc) · 1.2 KB
/
production-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
name: Prod React CI/CD
on:
push:
branches: [ "old-production" ]
pull_request:
branches: [ "old-production" ]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16]
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: Install dependencies
run: npm install
# - name: Run the tests
# run: npm run test
- name: Build
env:
REACT_APP_LEADERBOARD_API: ${{ secrets.REACT_APP_LEADERBOARD_API }}
run: npm run build
- name: Configure SSH key
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.PROD_SSH_PRIVATE_KEY }}
- name: Deploy
env:
REMOTE_IP: ${{ secrets.PROD_REMOTE_IP }}
FRONT_PROJECT_PATH: ${{ secrets.FRONT_PROJECT_PATH }}
run: |
ssh -o StrictHostKeyChecking=no ubuntu@$REMOTE_IP "rm -fr $FRONT_PROJECT_PATH/*"
rsync -avz -e "ssh -o StrictHostKeyChecking=no" build/* ubuntu@$REMOTE_IP:$FRONT_PROJECT_PATH