image: node:16

pipelines:
  branches:
    integration: 
      - step:
          name: Deploy Source to Server (integration) & Build
          script:
            - echo "Deploying nest-admin-dev to integration environment..." 
            - ssh $USER@$SERVER '
                cd /var/www/nest-business-admin-dev.sandbox-dev.co.uk && 
                git pull origin integration &&
                npm install --force &&
                npm run build &&
                pm2 restart nest-admin-dev-5003
              '
            - echo "integration Deployment completed successfully!"