Skip to content

자동 배포 테스트 #1

자동 배포 테스트

자동 배포 테스트 #1

Workflow file for this run

name: CI/CD Pipeline
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Check out the repository
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '16'
- name: Install dependencies
run: npm install
- name: Deploy to server
env:
DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }}
run: |
ssh -i $DEPLOY_KEY ec2-3-38-96-3.ap-northeast-2.compute.amazonaws.com << 'EOF'
cd /path/to/your/project
pm2 stop app.js || true
git pull origin main
npm install
pm2 start app.js
EOF