Skip to content

Commit

Permalink
Chore: Workflow 파일 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
ldhapple committed Dec 10, 2024
1 parent accb089 commit 84ba387
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Deploy Frontend

on:
push:
branches:
- main # main 브랜치 푸시 시 실행

jobs:
build-and-deploy:
runs-on: ubuntu-latest

steps:
# 1. GitHub 리포지토리에서 코드 가져오기
- name: Checkout code
uses: actions/checkout@v3

# 2. Node.js 설치 및 React 빌드
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 16

- name: Install dependencies and build
run: |
npm install
npm run build
# 3. 빌드 파일을 EC2 서버로 전송
- name: Upload build files to EC2
env:
HOST: ${{ secrets.FRONTEND_EC2_HOST }}
USER: ${{ secrets.FRONTEND_EC2_USER }}
KEY: ${{ secrets.FRONTEND_EC2_KEY }}
run: |
scp -o StrictHostKeyChecking=no -i $KEY -r ./build/* $USER@$HOST:/usr/share/nginx/html

0 comments on commit 84ba387

Please sign in to comment.