Skip to content

Commit

Permalink
Merge pull request #3 from peauty/feature/deploy
Browse files Browse the repository at this point in the history
Feat: Develop 자동 배포 및 typescript 타입 체크 액션 추가
  • Loading branch information
myoungjinGo-FE authored Nov 18, 2024
2 parents a076ac8 + a344300 commit 72d30c4
Show file tree
Hide file tree
Showing 5 changed files with 2,979 additions and 1,511 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: React build
on:
push:
branches:
- develop # 개발서버 배포

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

- name: Cache node modules # node_modules 캐싱
uses: actions/cache@v3
with:
path: node_modules
key: ${{ runner.OS }}-build-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.OS }}-build-
${{ runner.OS }}-
- name: Install Dependencies # 의존성 설치
run: yarn install

- name: Build # React 빌드
run: yarn build

- name: Deploy to S3 # S3에 배포
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: ${{ secrets.AWS_REGION }}
S3_BUCKET_NAME: ${{ secrets.S3_BUCKET_NAME_DEV }}
run: |
aws s3 cp \
--recursive \
--region $AWS_REGION \
dist s3://$S3_BUCKET_NAME
29 changes: 29 additions & 0 deletions .github/workflows/type_check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: TypeScript Check

on:
push:
branches:
- develop
- feature/**

jobs:
type-check:
runs-on: ubuntu-latest

steps:
- name: Checkout source code # 레포지토리 체크아웃
uses: actions/checkout@v3

- name: Set up Node.js # Node.js 설정
uses: actions/setup-node@v3
with:
node-version: 22 # 프로젝트에 맞는 Node.js 버전을 설정

- name: Install dependencies # 의존성 설치
run: yarn install

- name: Run TypeScript check # 타입스크립트 체크
run: yarn tsc --noEmit

- name: Build the project # 프로젝트 빌드
run: yarn build
Binary file added .yarn/install-state.gz
Binary file not shown.
1 change: 1 addition & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nodeLinker: node-modules
Loading

0 comments on commit 72d30c4

Please sign in to comment.