mirror of
https://github.com/FoggedLens/deflock.git
synced 2026-07-06 04:18:00 +02:00
github actions test
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
name: DeFlock API Deploy
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ts-backend] # changeme to master later
|
||||
|
||||
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
|
||||
- run: bun test
|
||||
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