Skip to content
Merged
Show file tree
Hide file tree
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
26 changes: 26 additions & 0 deletions .github/workflows/deploy-develop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Deploy to Staging

on:
push:
branches:
- develop

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v3

- name: Install Dependencies
run: |
npm ci
npm run build

- name: Deploy to Amplify (Staging)
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
run: |
npx amplify-cli publish --yes --branch develop
26 changes: 26 additions & 0 deletions .github/workflows/deploy-main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Deploy to Production

on:
push:
branches:
- main

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v3

- name: Install Dependencies
run: |
npm ci
npm run build

- name: Deploy to Amplify (Production)
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
run: |
npx amplify-cli publish --yes --branch main
68 changes: 0 additions & 68 deletions .github/workflows/deploy.yml

This file was deleted.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
},
"devDependencies": {
"@eslint/js": "^9.15.0",
"@types/node": "^22.10.2",
"@types/react": "^18.3.12",
"@types/react-dom": "^18.3.1",
"@vitejs/plugin-react": "^4.3.4",
Expand Down
68 changes: 68 additions & 0 deletions tmpdeploy.text
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# name: Netlify Deploy (Pull Request)

# on:
# pull_request:
# branches:
# - develop # develop 브랜치에 PR이 열리면 실행

# jobs:
# deploy:
# runs-on: ubuntu-latest

# steps:
# # 코드 체크아웃
# - name: Checkout code
# uses: actions/checkout@v3

# # 의존성 설치
# - name: Install dependencies
# run: npm install

# # 캐시된 Vite 빌드 복원 (Vite 빌드 캐시 저장)
# - name: Cache Vite build cache
# uses: actions/cache@v3
# with:
# path: |
# node_modules/.vite
# key: ${{ runner.os }}-vite-${{ hashFiles('**/vite.config.js') }}
# restore-keys: |
# ${{ runner.os }}-vite-

# # Netlify CLI 캐시 설정
# - name: Cache Netlify CLI
# uses: actions/cache@v3
# with:
# path: ~/.netlify
# key: ${{ runner.os }}-netlify-cli
# restore-keys: |
# ${{ runner.os }}-netlify-

# # Netlify CLI 설치
# - name: Install Netlify CLI
# run: npm install -g netlify-cli

# # 프로젝트 빌드
# - name: Build project
# run: npm run build

# # Netlify로 배포
# - name: Deploy to Netlify
# env:
# NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
# NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
# run: |
# # Netlify CLI 배포 명령어에 잘못된 하이픈 수정
# DEPLOY_OUTPUT=$(netlify deploy --auth=$NETLIFY_AUTH_TOKEN --site=$NETLIFY_SITE_ID --message "Deploy for PR" --json)
# DEPLOY_URL=$(echo $DEPLOY_OUTPUT | jq -r .deploy_url)
# echo "Deploy URL: $DEPLOY_URL"
# echo "TEST_DEPLOY_URL=$DEPLOY_URL" >> $GITHUB_ENV

# # PR에 배포 URL을 주석으로 추가
# - name: Add deploy URL to PR comment
# if: github.event_name == 'pull_request'
# run: |
# curl -s -X POST \
# -H "Authorization: token ${{ secrets.MY_PAT }}" \
# -H "Accept: application/vnd.github.v3+json" \
# https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments \
# -d '{"body": "🚀 Test site deployed: '"$TEST_DEPLOY_URL"'"}'
17 changes: 9 additions & 8 deletions vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";

// https://vite.dev/config/
export default defineConfig({
plugins: [
react({
jsxImportSource: "react", // React 자동 import 비활성화
}),
],
});
export default defineConfig(({ mode }) => ({
plugins: [react()],
define: {
"process.env": process.env,
},
build: {
outDir: mode === "production" ? "build" : "staging",
},
}));
Loading
Loading