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

[Feature][Task-None] Github Action CI/CD #42

Merged
merged 11 commits into from
Aug 9, 2024
Merged
48 changes: 48 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: React build
on:
push:
branches:
- deploy

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout source code
uses: actions/checkout@v3

- name: Clean Yarn cache
run: yarn cache clean

- name: Install Dependencies
run: yarn install --no-immutable

- name: Build Common
run: yarn run build:common

- name: Build Admin
run: yarn run build:admin

- name: Build User
run: yarn run build:user

- name: Deploy-Admin
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
run: |
aws s3 cp \
--recursive \
--region ap-northeast-2 \
packages/admin/dist s3://yangbong-admin

- name: Deploy-User
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
run: |
aws s3 cp \
--recursive \
--region ap-northeast-2 \
packages/user/dist s3://yangbong-front
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
"moment": "^2.30.1",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-helmet-async": "^2.0.5",
"react-router-dom": "^6.25.1",
"react-toastify": "^10.0.5",
"tailwind-merge": "^2.4.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/admin/src/pages/start/LoginPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function LoginPage() {

return (
<div className="flex h-full w-full flex-col items-center justify-center">
<p className="mb-10">Admin System</p>
<p className="mb-10">Admin System(ν•˜ν•˜ CI/CD 성곡?)</p>
<div className="flex w-[200px] flex-col gap-2">
<Input
placeholder="아이디λ₯Ό μž…λ ₯ν•˜μ„Έμš”."
Expand Down
5 changes: 3 additions & 2 deletions packages/common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@
"description": "Softeer Common Package",
"scripts": {
"tailwind": "npx tailwindcss -i src/styles/index.css -o ./dist/tailwind.css",
"build": "tsup",
"minify": "npx tailwindcss --minify -o ./dist/tailwind.css"
"bundle": "tsup",
"minify": "npx tailwindcss --minify -o ./dist/tailwind.css",
"build": "yes | yarn tailwind && yarn bundle && yes | yarn minify"
},
"exports": {
".": {
Expand Down
2 changes: 1 addition & 1 deletion packages/user/index.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!doctype html>
<html lang="en">
<html lang="kr">
<head>
<meta charset="UTF-8" />
<link href="/src/styles/index.css" rel="stylesheet" />
Expand Down
22 changes: 22 additions & 0 deletions packages/user/public/link/leisure.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<!doctype html>
<html lang="kr">
<head>
<meta charset="UTF-8" />
<title></title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta property='og:url' content='url hh' />
<meta property='og:type' content='website' />
<meta property='og:title' content='λ ˆμ €μ˜ 정석' />
<meta property='og:description' content='캐슀퍼 이벀트둜 μ΄ˆλŒ€ν•©λ‹ˆλ‹€.' />
<meta property='og:image' content='/link/og-leisure.png' />
<meta property='og:image:type' content='image/png' />
</head>
<body>
<script>
const currentUrl = new URL(window.location.href);
const baseUrl = "http://www.batro.org";
const newUrl = `${baseUrl}${currentUrl.pathname}${currentUrl.search}`;
window.location.href = newUrl;
</script>
</body>
</html>
Binary file added packages/user/public/link/og-leisure.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added packages/user/public/link/og-pet.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added packages/user/public/link/og-space.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added packages/user/public/link/og-travel.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 22 additions & 0 deletions packages/user/public/link/pet.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<!doctype html>
<html lang="kr">
<head>
<meta charset="UTF-8" />
<title></title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta property='og:url' content='url hh' />
<meta property='og:type' content='website' />
<meta property='og:title' content='펫 ν”„λ Œλ“€λ¦¬' />
<meta property='og:description' content='캐슀퍼 이벀트둜 μ΄ˆλŒ€ν•©λ‹ˆλ‹€.' />
<meta property='og:image' content='/link/og-pet.png' />
<meta property='og:image:type' content='image/png' />
</head>
<body>
<script>
const currentUrl = new URL(window.location.href);
const baseUrl = "http://www.batro.org";
const newUrl = `${baseUrl}${currentUrl.pathname}${currentUrl.search}`;
window.location.href = newUrl;
</script>
</body>
</html>
22 changes: 22 additions & 0 deletions packages/user/public/link/space.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<!doctype html>
<html lang="kr">
<head>
<meta charset="UTF-8" />
<title></title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta property='og:url' content='url hh' />
<meta property='og:type' content='website' />
<meta property='og:title' content='곡간 ν™œμš©μ˜ 기술' />
<meta property='og:description' content='캐슀퍼 이벀트둜 μ΄ˆλŒ€ν•©λ‹ˆλ‹€.' />
<meta property='og:image' content='/link/og-space.png' />
<meta property='og:image:type' content='image/png' />
</head>
<body>
<script>
const currentUrl = new URL(window.location.href);
const baseUrl = "http://www.batro.org";
const newUrl = `${baseUrl}${currentUrl.pathname}${currentUrl.search}`;
window.location.href = newUrl;
</script>
</body>
</html>
22 changes: 22 additions & 0 deletions packages/user/public/link/travel.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<!doctype html>
<html lang="kr">
<head>
<meta charset="UTF-8" />
<title></title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta property='og:url' content='url hh' />
<meta property='og:type' content='website' />
<meta property='og:title' content='μ—¬ν–‰μ˜ 정석' />
<meta property='og:description' content='캐슀퍼 이벀트둜 μ΄ˆλŒ€ν•©λ‹ˆλ‹€.' />
<meta property='og:image' content='/link/og-travel.png' />
<meta property='og:image:type' content='image/png' />
</head>
<body>
<script>
const currentUrl = new URL(window.location.href);
const baseUrl = "http://www.batro.org";
const newUrl = `${baseUrl}${currentUrl.pathname}${currentUrl.search}`;
window.location.href = newUrl;
</script>
</body>
</html>
35 changes: 0 additions & 35 deletions packages/user/src/components/shared/linkShare/LinkShareMetaTag.tsx

This file was deleted.

21 changes: 0 additions & 21 deletions packages/user/src/constants/teamDescriptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,3 @@ export const TEAM_DESCRIPTIONS: Record<Category, TeamDescriptions> = {
summary: 'μ˜€ν”„λ‘œλ“œλ„ μΊμŠ€νΌμ™€ ν•¨κ»˜',
},
} as const;

export type HelmetOption = { image: string; description: string };

export const TEAM_HELMET_OPTIONS: Record<Category, HelmetOption> = {
pet: {
description: '펫 ν”„λ Œλ“€λ¦¬\nλ°˜λ €λ™λ¬Όμ˜ νŽΈμ•ˆν•˜κ³ \nμ•ˆμ „ν•œ 여행을 μœ„ν•œ',
image: '/image/leisure.png',
},
travel: {
description: 'μ—¬ν–‰μ˜ 정석\n아웃도어 ν™œλ™μ„ 쉽고 νŽΈν•˜κ²Œ',
image: '/image/pet.png',
},
place: {
description: 'κ³΅κ°„ν™œμš©μ˜ 기술\nλ§Žμ€ 물건도 ꡬ석ꡬ석 μ•Œμ°¨κ²Œ',
image: '/image/place.png',
},
leisure: {
description: '펫 ν”„λ Œλ“€λ¦¬\nλ ˆμ €μ˜ 정석',
image: '/image/travel.png',
},
} as const;
4 changes: 1 addition & 3 deletions packages/user/src/libs/index.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import { PropsWithChildren } from 'react';
import { HelmetProvider } from 'react-helmet-async';

import QueryProvider from 'src/libs/query/index.tsx';

export default function AppProviders({ children }: PropsWithChildren) {
return (
<HelmetProvider>
<QueryProvider>{children}</QueryProvider>
</HelmetProvider>
);
}
3 changes: 1 addition & 2 deletions packages/user/src/routes/router.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { lazy, Suspense } from 'react';
import { createBrowserRouter, RouteObject } from 'react-router-dom';
import Layout from 'src/components/layout/index.tsx';
import LinkShareMetaTag from 'src/components/shared/linkShare/LinkShareMetaTag.tsx';
import RoutePaths from 'src/constants/routePath.ts';
import AuthProvider from 'src/context/auth/index.tsx';

Expand All @@ -13,7 +12,7 @@ const routes: RouteObject[] = [
path: RoutePaths.Index,
element: (
<AuthProvider>
<LinkShareMetaTag />
{/* <LinkShareMetaTag /> */}
<Layout />
</AuthProvider>
),
Expand Down
28 changes: 0 additions & 28 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5875,26 +5875,6 @@ __metadata:
languageName: node
linkType: hard

"react-fast-compare@npm:^3.2.2":
version: 3.2.2
resolution: "react-fast-compare@npm:3.2.2"
checksum: 10c0/0bbd2f3eb41ab2ff7380daaa55105db698d965c396df73e6874831dbafec8c4b5b08ba36ff09df01526caa3c61595247e3269558c284e37646241cba2b90a367
languageName: node
linkType: hard

"react-helmet-async@npm:^2.0.5":
version: 2.0.5
resolution: "react-helmet-async@npm:2.0.5"
dependencies:
invariant: "npm:^2.2.4"
react-fast-compare: "npm:^3.2.2"
shallowequal: "npm:^1.1.0"
peerDependencies:
react: ^16.6.0 || ^17.0.0 || ^18.0.0
checksum: 10c0/f390ea8bf13c2681850e5f8eb5b73d8613f407c245a5fd23e9db9b2cc14a3700dd1ce992d3966632886d1d613083294c2aeee009193f49dfa7d145d9f13ea2b0
languageName: node
linkType: hard

"react-is@npm:^16.13.1":
version: 16.13.1
resolution: "react-is@npm:16.13.1"
Expand Down Expand Up @@ -6423,13 +6403,6 @@ __metadata:
languageName: node
linkType: hard

"shallowequal@npm:^1.1.0":
version: 1.1.0
resolution: "shallowequal@npm:1.1.0"
checksum: 10c0/b926efb51cd0f47aa9bc061add788a4a650550bbe50647962113a4579b60af2abe7b62f9b02314acc6f97151d4cf87033a2b15fc20852fae306d1a095215396c
languageName: node
linkType: hard

"shebang-command@npm:^2.0.0":
version: 2.0.0
resolution: "shebang-command@npm:2.0.0"
Expand Down Expand Up @@ -6554,7 +6527,6 @@ __metadata:
prettier-plugin-tailwindcss: "npm:^0.6.5"
react: "npm:^18.3.1"
react-dom: "npm:^18.3.1"
react-helmet-async: "npm:^2.0.5"
react-router-dom: "npm:^6.25.1"
react-toastify: "npm:^10.0.5"
tailwind-merge: "npm:^2.4.0"
Expand Down
Loading