Skip to content

Merge pull request #2 from niraj-khatiwada/bugfix.docker-setup-prod #1

Merge pull request #2 from niraj-khatiwada/bugfix.docker-setup-prod

Merge pull request #2 from niraj-khatiwada/bugfix.docker-setup-prod #1

Workflow file for this run

name: prod-deployment
on:
push:
branches: [main]
workflow_dispatch:
jobs:
build:
runs-on: self-hosted
environment: production
steps:
- uses: actions/checkout@v2
- name: Executing remote command
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.PRODUCTION_EC2_HOST }}
USERNAME: ${{ secrets.PRODUCTION_EC2_USERNAME }}
PORT: ${{ secrets.PRODUCTION_EC2_PORT }}
KEY: ${{ secrets.PRODUCTION_EC2_PRIVATESSHKEY }}
command_timeout: 20m
script_stop: true
script: |
cd ~/nestjs-boilerplate
git reset --hard HEAD
git pull origin main
docker build --tag nestjs-boilerplate-prod:latest . --no-cache
pnpm docker:prod:down
pnpm docker:prod:up
docker volume prune -f