-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* refactor: api 경로 수정 * chore: 운영 배포 스크립트 작성 * fix: 실행 스크립트 수정 * feat: api url 수정 * chore: pr -> push 로 수정
- Loading branch information
1 parent
9f98fa8
commit 6818952
Showing
9 changed files
with
98 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
name: Admin Deploy | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build-and-deploy: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 10 | ||
|
||
permissions: | ||
checks: write | ||
pull-requests: write | ||
|
||
steps: | ||
- name: Repository 체크아웃 | ||
uses: actions/checkout@v3 | ||
|
||
- name: Node 설정 | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '18.16.1' | ||
|
||
- name: node_modules 캐싱 | ||
id: cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: '**/node_modules' | ||
key: ${{ runner.os }}-node-${{ hashFiles('**/yarn.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-node- | ||
- name: 의존성 설치 | ||
if: steps.cache.outputs.cache-hit != 'true' | ||
run: yarn install --pure-lockfile | ||
|
||
- name: .env 파일 생성 | ||
run: | | ||
echo "VITE_API_BASE_URL=${{ secrets.API_BASE_URL }}" > .env | ||
- name: 클라이언트 빌드 | ||
run: yarn build | ||
|
||
- name: AWS CLI 설정 | ||
uses: aws-actions/configure-aws-credentials@v1 | ||
with: | ||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY }} | ||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
aws-region: ap-northeast-2 | ||
|
||
- name: S3 이전 파일 삭제 | ||
run: | | ||
aws s3 rm ${{ secrets.AWS_S3_URL }} --recursive | ||
- name: S3에 배포 | ||
run: | | ||
aws s3 sync ./dist ${{ secrets.AWS_S3_URL }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
export const API_BASE_URL = import.meta.env.VITE_API_BASE_URL; | ||
|
||
export const API_ENDPOINT = { | ||
PRODUCT: '/products', | ||
REVIEW: '/reviews', | ||
CATEGORY: '/categories', | ||
LOGIN: '/login', | ||
LOGGED_CHECK: '/logged-check', | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,10 @@ | ||
import { defineConfig, loadEnv } from 'vite'; | ||
import { defineConfig } from 'vite'; | ||
import react from '@vitejs/plugin-react'; | ||
import { vanillaExtractPlugin } from '@vanilla-extract/vite-plugin'; | ||
|
||
// https://vitejs.dev/config/ | ||
export default defineConfig(({ mode }) => { | ||
const env = loadEnv(mode, process.cwd(), ''); | ||
export default defineConfig(() => { | ||
return { | ||
plugins: [react(), vanillaExtractPlugin()], | ||
server: { | ||
proxy: { | ||
'/api': { | ||
target: env.VITE_API_URL, | ||
changeOrigin: true, | ||
}, | ||
}, | ||
}, | ||
}; | ||
}); |