-
Notifications
You must be signed in to change notification settings - Fork 2
40 lines (38 loc) · 1.1 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
#FRONTEND
name: Build React App & Deploy to server
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js 16.x to Build
uses: actions/setup-node@v2
with:
node-version: 16.x
#cache: 'npm'
- run: npm install
working-directory: ./frontend
- run: REACT_APP_STAGE=production
- run: npm run build
working-directory: ./frontend
- name: ssh deploy on remote server
uses: easingthemes/[email protected]
with:
SSH_PRIVATE_KEY: ${{ secrets.SSH_KEY }}
REMOTE_HOST: ${{ secrets.DB_HOST }}
REMOTE_USER: centos
REMOTE_PORT: 22
SOURCE: './frontend/build/'
TARGET: ${{ secrets.DEPLOY_TARGET }}
env:
SSH_PRIVATE_KEY: ${{ secrets.SSH_KEY }}
REMOTE_HOST: ${{ secrets.DB_HOST }}
REMOTE_USER: centos
REMOTE_PORT: 22
SOURCE: './frontend/build/'
TARGET: ${{ secrets.DEPLOY_TARGET }}