forked from hotosm/tasking-manager
-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (47 loc) · 1.47 KB
/
build_and_deploy_frontend.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
name: Build and Deploy Tasking Manager Frontend
on:
push:
branches:
- deployment/naxa
paths:
- "frontend/**"
workflow_dispatch:
jobs:
deploy:
name: Deploy to Server
runs-on: [ubuntu-latest]
steps:
- name: Clone repository
uses: actions/checkout@v3
- name: SSH Run command
uses: appleboy/ssh-action@master
with:
host: ${{ vars.SERVER_IP }}
username: ${{ vars.SERVER_USERNAME }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
command_timeout: 20m
script: |
#!/bin/bash -i
echo '==In Server=='
echo '==Building Frontend=='
export NVM_DIR=~/.nvm
source ~/.nvm/nvm.sh
cd /tmp
git clone https://github.com/naxa-developers/tasking-manager
cd tasking-manager
git checkout ${{ github.ref }}
cp /home/ubuntu/Projects/tasking-manager/tasking-manager.env .
nvm i 16
nvm use 16
npm i -g yarn
yarn install
npm run build
cp frontend/build/* /home/ubuntu/Projects/tasking-manager/frontend/build/
# cd /home/ubuntu/Projects/tasking-manager
# git pull naxa deployment/naxa
# cd /home/ubuntu/Projects/tasking-manager/frontend
# nvm i 16
# nvm use 16
# npm i -g yarn
# yarn install
# npm run build