-
Notifications
You must be signed in to change notification settings - Fork 0
38 lines (34 loc) · 1.02 KB
/
fwqgo.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
name: Deploy to Ubuntu Server
on:
push:
branches: [main]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/[email protected]
with:
node-version: "18"
- name: Deploy to Server
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SERVER_IP }}
username: ${{ secrets.SERVER_USER }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
script: |
echo "Connection successful"
cd /home/${{ secrets.SERVER_USER }}/www/fwqgo
pm2 stop ecosystem.config.cjs
rm -rf node_modules
rm -rf .next
echo "remove success"
git pull origin main
echo "git pull successfiul"
echo "DATABASE_URL=${{ secrets.DATABASE_URL }}" >> .env
echo "set DATABASE_URL"
npm install
npm run build
pm2 start ecosystem.config.cjs
echo "pm2 start success"