Skip to content

Commit

Permalink
fix: ci 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
ssojungg committed Jan 17, 2024
1 parent 1837d0b commit f0b4ec5
Showing 1 changed file with 50 additions and 11 deletions.
61 changes: 50 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,30 +32,69 @@ jobs:
node-version: [18.x]

steps:
- uses: actions/checkout@v3 # 버전을 최신으로 업데이트
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3 # 버전을 최신으로 업데이트
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Install Dependencies
run: npm install

- name: Build
run: npm run build --if-present
# 백엔드 의존성 설치
- name: Install backend dependencies
run: |
cd backend
npm install
# 백엔드 빌드
- name: Build backend
run: |
cd backend
npm run build --if-present
# 백엔드 린트
- name: Lint backend
run: |
cd backend
npm run lint
# 프론트엔드 의존성 설치
- name: Install frontend dependencies
run: |
cd frontend
npm install
# 프론트엔드 빌드
- name: Build frontend
run: |
cd frontend
npm run build --if-present
- name: Lint
run: npm run lint
# 프론트엔드 린트
- name: Lint frontend
run: |
cd frontend
npm run lint
- name: Install AWS CLI
run: |
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
sudo ./aws/install
- name: Upload to AWS S3
if: success() # 이전 단계가 성공했을 경우에만 실행
# AWS S3로 백엔드 빌드 파일 업로드
- name: Upload backend to AWS S3
if: success()
run: |
aws s3 cp ./backend/build s3://${{ secrets.AWS_BUCKET }}/backend/ --recursive
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_S3_ACCESS_KEY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_S3_SECRET_KEY }}
AWS_DEFAULT_REGION: ${{ secrets.AWS_S3_REGION }}

# AWS S3로 프론트엔드 빌드 파일 업로드
- name: Upload frontend to AWS S3
if: success()
run: |
aws s3 cp ./build s3://${{ secrets.AWS_BUCKET }}/ --recursive
aws s3 cp ./frontend/build s3://${{ secrets.AWS_BUCKET }}/frontend/ --recursive
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_S3_ACCESS_KEY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_S3_SECRET_KEY }}
Expand Down

0 comments on commit f0b4ec5

Please sign in to comment.