mirror of
https://github.com/FoggedLens/deflock.git
synced 2026-05-21 07:06:48 +02:00
39 lines
935 B
YAML
39 lines
935 B
YAML
name: Deploy DeFlock Backend
|
|
|
|
on:
|
|
push:
|
|
branches: [static-site]
|
|
# TODO: change to master after testing
|
|
|
|
jobs:
|
|
deploy:
|
|
runs-on: ubuntu-latest
|
|
defaults:
|
|
run:
|
|
working-directory: backend
|
|
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Setup Node
|
|
uses: actions/setup-node@v3
|
|
with:
|
|
node-version: 20
|
|
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
|
|
- name: Build TypeScript
|
|
run: npm run build
|
|
|
|
- name: Deploy to VPS
|
|
uses: appleboy/ssh-action@v1
|
|
with:
|
|
host: ${{ secrets.VPS_HOST }}
|
|
username: app
|
|
key: ${{ secrets.VPS_SSH_KEY }}
|
|
script: |
|
|
mkdir -p /home/nullplate/deflock/backend/dist
|
|
rsync -avz --delete ./dist/ /home/nullplate/deflock/backend/dist/
|
|
pm2 reload df-backend || pm2 start /home/nullplate/deflock/backend/dist/server.js --name df-backend
|