Skip to content

Commit

Permalink
add cd_prod for ssh redeploy
Browse files Browse the repository at this point in the history
  • Loading branch information
SuzalShrestha committed Feb 5, 2025
1 parent e84c215 commit 3461ab6
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/cd_prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Deploy to Production
on:
push:
branches:
- production

jobs:
redeploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: executing remote ssh commands using ssh key
uses: appleboy/[email protected]
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.KEY }}
port: ${{ secrets.PORT }}
script: |
cd ~/0txt
# git reset --hard
# git clean -fd
git checkout production
git pull origin production
npm install
npm run lint
npm run build
pm2 stop 0txt-prod || true
pm2 start npm --name "0txt-prod" -- run start
pm2 save

0 comments on commit 3461ab6

Please sign in to comment.