mirror of
https://github.com/FoggedLens/deflock.git
synced 2026-02-12 23:12:48 +00:00
separate fe and be, deploy on push to master
This commit is contained in:
38
.github/workflows/deflock-api-deploy.yml
vendored
Normal file
38
.github/workflows/deflock-api-deploy.yml
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
name: DeFlock API Deploy
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [master]
|
||||
|
||||
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
|
||||
"
|
||||
Reference in New Issue
Block a user