Skip to content

Commit

Permalink
Create main.yml
Browse files Browse the repository at this point in the history
CI/CD
  • Loading branch information
Danjjinbibbang authored Oct 10, 2024
1 parent d74ddaf commit 5d8c866
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: React build
on:
push: # main 브랜치에 push 이벤트가 일어났을 때만 실행
branches:
- main

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout source code # 레포지토리 체크아웃
uses: actions/checkout@v2

- name: Cache node modules # node modules 캐싱
uses: actions/cache@v3
with:
path: node_modules # 프로젝트의 node_modules 경로로 설정
key: ${{ runner.OS }}-build-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.OS }}-build-
${{ runner.OS }}-
- name: Install Dependencies # 의존성 설치
run: npm install # npm install을 실행할 경로로 설정

- name: Build # React 빌드
run: npm run build # npm run build를 실행할 경로로 설정

- name: Deploy # S3에 배포
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
run: |
aws s3 cp \
--recursive \
--region ap-northeast-2 \
build/ s3://mindcandy-febucket # 버킷 이름으로 변경

0 comments on commit 5d8c866

Please sign in to comment.