Skip to content

Another deploy test

Another deploy test #3

Workflow file for this run

name: Production Deployment [NextJS]
on:
pull_request:
branches: [production]
types : [closed]
push:
branches: [production]
workflow_dispatch:
jobs:
deploy:
if: (github.event.pull_request.merged == true || github.event_name == 'workflow_dispatch')
runs-on: ubuntu-latest
steps:
- name: Deploy using ssh
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.PRODUCTION_HOST }}
username: ${{ secrets.PRODUCTION_USERNAME }}
key: ${{ secrets.PRODUCTION_PRIVATE_KEY }}
port: 22
script: |
cd ${{ vars.REPOSITORY_DIRECTORY }}
git pull origin production
git status
npm install --only=prod
npm build
npx pm2 restart ${{ vars.PM2_PROCESS }}
run: |
echo Pull request merged and deployed to Production