-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (49 loc) · 1.66 KB
/
main.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
name: React Deploy
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-20.04
steps:
- name: checkout master
uses: actions/checkout@v3
- name: cache node modules
uses: actions/[email protected]
with:
path: node_modules
key: ${{runner.OS}}-build-${{hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.OS }}-build-
${{ runner.OS }}
- name: Install Dependencies
run: npm install
#Build : ./build 디렉토리에 폴더 생성
- name: Build
run: CI=false npm run build
#Deploy to server
- name: Deploy to Server
# uses: easingthemes/[email protected]
env:
# PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
# HOST: ${{ secrets.SERVER_HOST }}
# USERNAME: ${{ secrets.SERVER_USERNAME }}
# PORT: ${{ secrets.SERVER_PORT }}
# password: ${{ secrets.NPC_DEV_SERVER_PASSWORD }}
# PRIVATE_KEY: ${{ secrets.NCP_PRI_KEY }}
# HOST: ${{ secrets.NCP_HOST }}
# USERNAME: ${{ secrets.NCP_USR_NM }}
# PORT: ${{ secrets.NCP_PORT }}
# password: ${{ secrets.NCP_USR_PWD }}
PRIVATE_KEY: ${{ secrets.NCP_PRI_KEY }}
HOST: 10.36.68.139
USERNAME: root
PORT: 3334
PASSWORD: Y3!ui9a=La
run: |
echo "$PRIVATE_KEY" > private_key.pem
chmod 400 private_key.pem
scp -i private_key.pem -P $PORT -o StrictHostKeyChecking=no -r build/ $USERNAME@$HOST:/var/www/html/
ssh -i private_key.pem -p $PORT -o StrictHostKeyChecking=no $USERNAME@$HOST 'bash -s' <<- EOF
rm -f private_key.pem