Skip to content

Commit 587482c

Browse files
authored
Create deploy.yml
1 parent b19faf3 commit 587482c

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

.github/workflows/deploy.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Deploy CV Builder
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
deploy:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout repo
13+
uses: actions/checkout@v3
14+
15+
- name: Set up Node.js
16+
uses: actions/setup-node@v3
17+
with:
18+
node-version: 20
19+
20+
- name: Build frontend
21+
working-directory: ./frontend
22+
run: |
23+
npm install
24+
npm run build
25+
26+
- name: Deploy to server via SSH
27+
uses: appleboy/[email protected]
28+
with:
29+
host: ${{ secrets.SERVER_IP }}
30+
username: ${{ secrets.SERVER_USER }}
31+
key: ${{ secrets.SERVER_SSH_KEY }}
32+
script: |
33+
cd ~/next-steps-cv-builder
34+
git pull origin main
35+
cd frontend
36+
npm install
37+
npm run build
38+
sudo rm -rf /var/www/html/*
39+
sudo cp -r dist/* /var/www/html/
40+
cd ../backend
41+
npm install
42+
pm2 restart backend
43+
sudo systemctl reload nginx

0 commit comments

Comments
 (0)