Skip to content

Commit

Permalink
deploy on tag change
Browse files Browse the repository at this point in the history
  • Loading branch information
yerlantemir committed Aug 8, 2023
1 parent d95312c commit 26371f2
Showing 1 changed file with 22 additions and 5 deletions.
27 changes: 22 additions & 5 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
name: CI/CD Workflow
name: Deploy

on:
workflow_dispatch:
push:
branches: [main]
paths:
- 'backend/**'
tags:
- 'v*'

jobs:
deploy:
Expand All @@ -18,4 +17,22 @@ jobs:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.KEY }}
script: 'cd /home/vimracing && git pull && yarn && cd shared && yarn build && cd ../backend && yarn run build && pm2 delete -s vimracing || : && pm2 start dist/index.js --name vimracing'
script: |
cd /home/vimracing

git pull
yarn

cd shared
yarn build

cd ../frontend
yarn build
pm2 delete -s vimracing || :
pm2 start --name api.vimracing

cd ../backend
yarn run build

pm2 delete -s api.vimracing || :
pm2 start dist/index.js --name api.vimracing

0 comments on commit 26371f2

Please sign in to comment.