Skip to content

Commit 2ab6bda

Browse files
authored
Merge pull request #27 from AcneLog/dev
dev to main [ cicd 작업 ]
2 parents 1ccb3f1 + 1dc72ca commit 2ab6bda

2 files changed

Lines changed: 48 additions & 3 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Deploy to S3
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
deploy:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout repository
14+
uses: actions/checkout@v3
15+
16+
- name: Set up Node.js
17+
uses: actions/setup-node@v3
18+
with:
19+
node-version: 18
20+
21+
- name: Install dependencies
22+
run: npm ci
23+
24+
- name: Build app
25+
run: npm run build
26+
27+
- name: Deploy to S3
28+
uses: jakejarvis/s3-sync-action@master
29+
with:
30+
args: --delete
31+
env:
32+
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
33+
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
34+
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
35+
AWS_REGION: ${{ secrets.AWS_REGION }}
36+
SOURCE_DIR: ./dist
37+
38+
- name: Invalidate CloudFront cache
39+
uses: chetan/invalidate-cloudfront-action@v2
40+
env:
41+
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
42+
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
43+
DISTRIBUTION: ${{ secrets.AWS_CLOUDFRONT_DISTRIBUTION_ID }}
44+
PATHS: '/*'

vite.config.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
import { defineConfig } from 'vite'
2-
import react from '@vitejs/plugin-react'
1+
import { defineConfig } from 'vite';
2+
import react from '@vitejs/plugin-react';
33

44
// https://vite.dev/config/
55
export default defineConfig({
6+
base: '/',
67
plugins: [react()],
7-
})
8+
});

0 commit comments

Comments
 (0)