-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (38 loc) · 1018 Bytes
/
deploy.yml
File metadata and controls
43 lines (38 loc) · 1018 Bytes
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
name: Deploy CV Builder
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 20
- name: Build frontend
working-directory: ./frontend
run: |
npm install
npm run build
- name: Deploy to server via SSH
uses: appleboy/ssh-action@v0.1.9
with:
host: ${{ secrets.SERVER_IP }}
username: ${{ secrets.SERVER_USER }}
key: ${{ secrets.SERVER_SSH_KEY }}
script: |
cd ~/next-steps-cv-builder
git pull origin main
cd frontend
npm install
npm run build
sudo rm -rf /var/www/html/*
sudo cp -r dist/* /var/www/html/
cd ../backend
npm install
pm2 restart backend
sudo systemctl reload nginx