Skip to content

Commit 2316fa2

Browse files
authored
Merge pull request #74 from WithTime12/develop
[Deploy] 배포
2 parents d9a1a07 + 7d4f24d commit 2316fa2

File tree

363 files changed

+15836
-1292
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

363 files changed

+15836
-1292
lines changed

.github/workflows/ci.yaml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: CI
2+
3+
on: [pull_request]
4+
5+
jobs:
6+
lint:
7+
name: Lint
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- uses: actions/checkout@v3
12+
- uses: actions/setup-node@v2
13+
with:
14+
node-version: '18'
15+
- name: Install pnpm
16+
run: npm install -g pnpm
17+
18+
- name: Install dependencies
19+
run: pnpm install
20+
21+
- name: Run lint
22+
run: pnpm lint
23+
build:
24+
name: Build
25+
runs-on: ubuntu-latest
26+
27+
steps:
28+
- uses: actions/checkout@v3
29+
- uses: actions/setup-node@v2
30+
with:
31+
node-version: '18'
32+
- name: Install pnpm
33+
run: npm install -g pnpm
34+
35+
- name: Install dependencies
36+
run: pnpm install
37+
38+
- name: Run build
39+
run: CI='false' pnpm build

.github/workflows/main.yaml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: cicd action
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout source code
14+
uses: actions/checkout@v3
15+
16+
- name: Check Node.js version
17+
run: node -v
18+
19+
- name: Install pnpm
20+
run: npm install -g pnpm
21+
22+
- name: Create .env file
23+
run: |
24+
echo "VITE_API_BASE_URL=${{ secrets.VITE_API_BASE_URL }}" >> .env
25+
- name: Install dependencies
26+
run: pnpm install
27+
28+
- name: Configure AWS credentials
29+
uses: aws-actions/configure-aws-credentials@v4
30+
with:
31+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
32+
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
33+
aws-region: ${{ secrets.AWS_REGION }}
34+
35+
- name: Generate build
36+
run: pnpm run build
37+
38+
- name: Deploy to S3
39+
run: |
40+
aws s3 cp --recursive --region ap-northeast-2 dist s3://${{ secrets.AWS_BUCKET_NAME }}
41+
42+
- name: Invalidate CloudFront Cache
43+
run: aws cloudfront create-invalidation --distribution-id ${{ secrets.AWS_DISTRIBUTION_ID }} --paths "/*"
44+
continue-on-error: true
45+
46+
- name: Notify Discord
47+
if: success()
48+
run: |
49+
curl -H "Content-Type: application/json" \
50+
-X POST \
51+
-d "{\"content\": \"✅ 배포가 완료되었습니다! 🎉 (브랜치: main)\"}" \
52+
${{ secrets.DISCORD_WEBHOOK_URL }}

0 commit comments

Comments
 (0)