Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

프론트엔드 개발 서버 구축 #137

Merged
merged 7 commits into from
Jul 16, 2024
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
78 changes: 78 additions & 0 deletions .github/workflows/deploy_development.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: React Development Deploy
on:
push:
branches:
- develop
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: checkout Github Action
uses: actions/checkout@v3

- name: .env setting
run: |
echo "VITE_BASE_SERVER_URL=${{ secrets.VITE_BASE_DEV_SERVER_URL }}" >> .env
echo "VITE_APP_FCM_API_KEY=${{ secrets.VITE_APP_FCM_API_KEY }}" >> .env
echo "VITE_APP_FCM_AUTH_DOMAIN=${{ secrets.VITE_APP_FCM_AUTH_DOMAIN }}" >> .env
echo "VITE_APP_FCM_PROJECT_ID=${{ secrets.VITE_APP_FCM_PROJECT_ID }}" >> .env
echo "VITE_APP_FCM_STORAGE_BUCKET=${{ secrets.VITE_APP_FCM_STORAGE_BUCKET }}" >> .env
echo "VITE_APP_FCM_MESSAGING_SENDER_ID=${{ secrets.VITE_APP_FCM_MESSAGING_SENDER_ID }}" >> .env
echo "VITE_APP_FCM_APP_ID=${{ secrets.VITE_APP_FCM_APP_ID }}" >> .env
echo "VITE_APP_FCM_MEASUREMENT_ID=${{ secrets.VITE_APP_FCM_MEASUREMENT_ID }}" >> .env
echo "VITE_APP_FCM_VAPID_KEY=${{ secrets.VITE_APP_FCM_VAPID_KEY }}" >> .env

- name: Create appspec.yml
run: |
cat << EOF > appspec.yml
version: 0.0
os: linux
files:
- source: /
destination: /home/ubuntu/mallang-trip-dev
overwrite: yes
permissions:
- object: /home/ubuntu/mallang-trip-dev
owner: ubuntu
group: ubuntu
mode: 755
EOF

- name: Check Node version
run: node -v

- name: Install Dependencies
run: npm install

- name: Build
run: npm run build -- --outDir=dev
env:
CI: ""

- name: Remove Dependencies
run: rm -rf node_modules

- name: zip create
run: zip -qq -r ./react-build.zip .
shell: bash

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_REGION }}

- name: Upload to S3
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
run: |
aws s3 cp --region ap-northeast-2 ./react-build.zip s3://mallang-trip-react/react-build.zip

- name: Deploy # Deploy to EC2
run: aws deploy create-deployment
--application-name codedeploy-react
--deployment-config-name CodeDeployDefault.AllAtOnce
--deployment-group-name react-app
--s3-location bucket=mallang-trip-react,key=react-build.zip,bundleType=zip
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: React Deploy
name: React Production Deploy
on:
push:
branches:
Expand All @@ -22,6 +22,22 @@ jobs:
echo "VITE_APP_FCM_MEASUREMENT_ID=${{ secrets.VITE_APP_FCM_MEASUREMENT_ID }}" >> .env
echo "VITE_APP_FCM_VAPID_KEY=${{ secrets.VITE_APP_FCM_VAPID_KEY }}" >> .env

- name: Create appspec.yml
run: |
cat << EOF > appspec.yml
version: 0.0
os: linux
files:
- source: /
destination: /home/ubuntu/mallang-trip
overwrite: yes
permissions:
- object: /home/ubuntu/mallang-trip
owner: ubuntu
group: ubuntu
mode: 755
EOF

- name: Check Node version
run: node -v

Expand All @@ -33,6 +49,9 @@ jobs:
env:
CI: ""

- name: Remove Dependencies
run: rm -rf node_modules

- name: zip create
run: zip -qq -r ./react-build.zip .
shell: bash
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@ dist-ssr
*.sw?

# dotenv environment variable files
.env
.env
.env.development
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"type": "module",
"scripts": {
"dev": "vite",
"production": "vite --mode production",
"build": "vite build",
"lint": "eslint . --ext js,jsx --report-unused-disable-directives --max-warnings 0",
"preview": "vite preview"
Expand Down
13 changes: 8 additions & 5 deletions src/pages/MyHeartPage/HeartItem/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,18 @@ function HeartItem({
: navigate(`/destination/detail/${destinationId}`)
}
>
<img
className="absolute top-0 left-0 object-cover object-center w-full h-full overflow-hidden rounded-lg"
src={image}
alt="heart-image"
/>
{image ? (
<img
className="absolute top-0 left-0 object-cover object-center w-full h-full overflow-hidden rounded-lg"
src={image}
alt={name}
/>
) : null}
<img
className="absolute top-2 right-2 cursor-pointer z-10"
src={heart ? FillHeart : EmptyHeart}
onClick={heartClickHandler}
alt="image"
/>
<div className="absolute top-0 left-0 flex flex-col items-center justify-center w-full h-full rounded-lg text-white bg-black bg-opacity-50">
<div className="text-xl">{name}</div>
Expand Down
11 changes: 11 additions & 0 deletions src/pages/PartyPage/PartyIntro/index.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
function PartyIntro({ content }) {
if (!content) return;
return (
<div className="flex flex-col gap-1 my-7">
<p className="text-lg text-black font-bold">파티 소개</p>
<p className="text-sm text-darkgray">{content}</p>
</div>
);
}

export default PartyIntro;
2 changes: 2 additions & 0 deletions src/pages/PartyPage/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import ConfirmModal from "../../components/ConfirmModal";
import CheckModal from "../../components/CheckModal";
import PartyDate from "./PartyDate";
import PartyMember from "./PartyMember";
import PartyIntro from "./PartyIntro";
import ToTalPrice from "./ToTalPrice";
import JoinButton from "./JoinButton";
import CreditInfo from "./CreditInfo";
Expand Down Expand Up @@ -285,6 +286,7 @@ function PartyPage() {
startDate={partyData.startDate}
/>
)}
<PartyIntro content={partyData.content} />
<ToTalPrice
totalPrice={
user.userId === partyData.driverId
Expand Down
Loading