-
Notifications
You must be signed in to change notification settings - Fork 0
30 lines (25 loc) · 816 Bytes
/
deploy.yml
File metadata and controls
30 lines (25 loc) · 816 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
name: Deploy to VPS
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Deploy via SSH
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.VPS_IP }}
username: ${{ secrets.VPS_USERNAME }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
script: |
echo "[INFO] Cloning latest code..."
rm -rf codeboxes-server
git clone https://github.com/harshpx/codeboxes-server.git
cd codeboxes-server
echo "[INFO] Injecting secrets..."
echo "${{secrets.SECRETS_PROPERTIES}}" > ./server/src/main/resources/secrets.properties
echo "[INFO] Executing deployment script..."
chmod +x ./build-and-run.sh
./build-and-run.sh