Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: Vite Build and Deploy

on:
on:
push:
branches:
- main
pull_request: # PR 생성 시 실행되도록 추가
pull_request: # PR 생성 시 실행되도록 추가
branches:
- main

Expand Down Expand Up @@ -33,16 +33,28 @@ jobs:
- name: Debug Build Directory
run: ls -l dist || echo "dist/ directory not found"

- name: Upload build artifact
uses: actions/upload-artifact@v4
with:
name: dist
path: dist/

deploy:
if: github.event_name == 'push' # push 일 때만 배포 실행
runs-on: ubuntu-latest
needs: build # build가 성공해야 deploy 실행
steps:
- name: Download build artifact
uses: actions/download-artifact@v4
with:
name: dist
path: dist

- name: Deploy to S3
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
run: |
aws s3 sync \
dist/ s3://valia-react/ \
--region ap-northeast-2
--region ap-northeast-2