Skip to content

Merge branch 'master' of github.com:nur-wahid123/nest-pos-be #3

Merge branch 'master' of github.com:nur-wahid123/nest-pos-be

Merge branch 'master' of github.com:nur-wahid123/nest-pos-be #3

Workflow file for this run

name: Docker Build and Deploy
on:
push:
branches:
- master
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Set up SSH
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
ssh-passphrase: ${{ secrets.SSH_PASSPHRASE }} # Only if you have a passphrase
- name: Deploy to remote server
run: |
ssh -o StrictHostKeyChecking=no ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} << EOF
cd ~/pos-app/nest-pos-be
git pull origin master
docker compose down || true
docker build -t nestjs-app .
docker compose up -d
docker image prune -a -f
EOF