-
Notifications
You must be signed in to change notification settings - Fork 1
40 lines (33 loc) · 949 Bytes
/
fastcd.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
name: CI/CD Pipeline
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
# 리포지토리의 코드를 체크아웃합니다.
- name: Check out the repository
uses: actions/checkout@v3
# Node.js 환경을 설정합니다.
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '16'
# 프로젝트의 의존성을 설치합니다.
- name: Install dependencies
run: npm install
- name: Deploy to AWS EC2
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SERVER_IP }}
username: ubuntu
key: ${{ secrets.SSH_PRIVATE_KEY }}
script: |
cd Pironeer_Attend_Web/
git pull origin main
npm install
pm2 stop app.js || true
pm2 start app.js
sudo systemctl restart nginx