-
-
Notifications
You must be signed in to change notification settings - Fork 67
40 lines (32 loc) · 935 Bytes
/
deflock-api-deploy.yml
File metadata and controls
40 lines (32 loc) · 935 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
name: DeFlock API Deploy
on:
push:
branches: [master]
paths:
- 'api/**'
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v1
with:
bun-version: latest
- run: bun install
working-directory: ./api
- name: Configure SSH
run: |
mkdir -p ~/.ssh
echo "${{ secrets.VPS_SSH_KEY }}" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh-keyscan -H ${{ secrets.VPS_HOST }} >> ~/.ssh/known_hosts
- name: Sync files
run: |
rsync -az --delete \
--exclude node_modules \
./api/ ${{ secrets.VPS_USERNAME }}@${{ secrets.VPS_HOST }}:/home/nullplate/deflock/api
- name: Restart services
run: |
ssh ${{ secrets.VPS_USERNAME }}@${{ secrets.VPS_HOST }} "
sudo systemctl restart deflock-api
"