-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (41 loc) · 1.04 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
name: Build and Deploy
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: '18.17.1'
architecture: 'x64'
- name: Install npm
run: |
npm install -g npm@9.6.7
- name: Install dependencies
run: |
cd app
npm install
- name: Set CI to false
run: echo "CI=false" >> $GITHUB_ENV
- name: Build
run: |
cd app
echo "Current directory: $(pwd)"
ls -la
npm -v
node -v
npm run build --loglevel verbose
echo "Build complete"
- name: Install sshpass
run: sudo apt-get install -y sshpass
- name: Deploy to server
run: |
/usr/bin/sshpass -p 3gd ssh ${{ secrets.SERVER_USERNAME }}@${{ secrets.SERVER_HOST }}
env:
SSHPASS: ${{ secrets.SERVER_PASSWORD }}