Skip to content

Commit

Permalink
Merge pull request #137 from Clubber2024/dev
Browse files Browse the repository at this point in the history
서버 배포 분리 작업 운영 클라이언트 환경 적용
  • Loading branch information
mjKim1229 authored Oct 14, 2024
2 parents a6febc4 + ff87cf0 commit cd8ff87
Show file tree
Hide file tree
Showing 25 changed files with 1,076 additions and 601 deletions.
43 changes: 0 additions & 43 deletions .github/workflows/cd-prod.yml

This file was deleted.

44 changes: 44 additions & 0 deletions .github/workflows/ci-cd-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# name: CI-CD dev

# on:
# push:
# branches:
# - dev

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

# strategy:
# matrix:
# node-version: [16.16.0]

# steps:
# - uses: actions/checkout@v2
# - name: Use Node.js ${{ matrix.node-version }}
# uses: actions/setup-node@v1
# with:
# node-version: ${{ matrix.node-version }}

# - name: Set environment variables for staging
# if: github.ref == 'refs/heads/dev'
# run: echo "${{ secrets.STAGING_ENV }}" > .env

# - name: docker build and push
# run: |
# docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }}
# docker build -t ${{ secrets.DOCKER_REPO }}/clubber-front-dev .
# docker push ${{ secrets.DOCKER_REPO }}/clubber-front-dev

# - name: executing remote ssh commands using password
# uses: appleboy/ssh-action@master
# with:
# host: ${{ secrets.SSH_HOST }}
# username: ${{ secrets.SSH_USERNAME }}
# key: ${{ secrets.SSH_KEY }}
# port: ${{ secrets.SSH_PORT }}
# script: |
# sudo docker rm -f $(docker ps -qa)
# sudo docker pull ${{ secrets.DOCKER_REPO }}/clubber-front-dev
# docker-compose up -d
# docker image prune -f
43 changes: 43 additions & 0 deletions .github/workflows/ci-cd-prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# name: CI-CD prod

# on:
# push:
# branches:
# - main

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

# strategy:
# matrix:
# node-version: [16.16.0]

# steps:
# - uses: actions/checkout@v2
# - name: Use Node.js ${{ matrix.node-version }}
# uses: actions/setup-node@v1
# with:
# node-version: ${{ matrix.node-version }}

# - name: Set environment variables for production
# run: echo "${{ secrets.PRODUCTION_ENV }}" > .env

# - name: Docker build and push
# run: |
# docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }}
# docker build -t ${{ secrets.DOCKER_REPO }}/clubber-front .
# docker push ${{ secrets.DOCKER_REPO }}/clubber-front

# - name: Executing remote SSH commands
# uses: appleboy/ssh-action@master
# with:
# host: ${{ secrets.SSH_HOST_PROD }}
# username: ${{ secrets.SSH_USERNAME }}
# key: ${{ secrets.SSH_KEY_PROD }}
# port: ${{ secrets.SSH_PORT }}
# script: |
# sudo docker rm -f $(docker ps -qa)
# sudo docker pull ${{ secrets.DOCKER_REPO }}/clubber-front
# docker-compose up -d
# docker image prune -f
71 changes: 71 additions & 0 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: CI-CD

on:
push:
branches: [ "main", "dev" ]

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [16.16.0]

steps:
- uses: actions/checkout@v2

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}

- name: Set environment variables for staging
if: contains(github.ref, 'dev')
run: echo "${{ secrets.STAGING_ENV }}" > .env

- name: Set environment variables for prod
if: contains(github.ref, 'main')
run: echo "${{ secrets.PRODUCTION_ENV }}" > .env

- name: Docker build and push to dev
if: contains(github.ref, 'dev')
run: |
docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }}
docker build -t ${{ secrets.DOCKER_REPO }}/clubber-front-dev .
docker push ${{ secrets.DOCKER_REPO }}/clubber-front-dev
- name: Docker build and push to prod
if: contains(github.ref, 'main')
run: |
docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }}
docker build -t ${{ secrets.DOCKER_REPO }}/clubber-front-prod .
docker push ${{ secrets.DOCKER_REPO }}/clubber-front-prod
- name: Deploy to dev
if: contains(github.ref, 'dev')
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USERNAME }}
key: ${{ secrets.SSH_KEY }}
port: ${{ secrets.SSH_PORT }}
script: |
sudo docker rm -f $(docker ps -qa)
sudo docker pull ${{ secrets.DOCKER_REPO }}/clubber-front-dev
sudo docker-compose -f docker-compose-dev.yml up -d
docker image prune -f
- name: Deploy to prod
if: contains(github.ref, 'main')
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SSH_HOST_PROD }}
username: ${{ secrets.SSH_USERNAME }}
key: ${{ secrets.SSH_KEY_PROD }}
port: ${{ secrets.SSH_PORT }}
script: |
sudo docker rm -f $(docker ps -qa)
sudo docker pull ${{ secrets.DOCKER_REPO }}/clubber-front-prod
sudo docker-compose -f docker-compose-prod.yml up -d
docker image prune -f
56 changes: 0 additions & 56 deletions .github/workflows/ci.yml

This file was deleted.

3 changes: 3 additions & 0 deletions src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import RecruitContent from './component/recruit/RecruitContent';
import ModifyPassword from './component/mypage/ModifyPassword';
import AdminRecruitWrite from './component/admin/recruit/AdminRecruitWrite';
import DetailRecruitList from './component/recruit/DetailRecruitList';
import AdminRecruitContent from './component/admin/recruit/AdminRecruitContent';

function App() {
const appStyle = {
Expand Down Expand Up @@ -84,6 +85,7 @@ function App() {
<Route path="/admin/mypage/pending" element={<PendingList />} />
<Route path="/admin/recruit" element={<AdminRecruitList />} />
<Route path="/admin/recruit/edit" element={<AdminRecruitWrite />} />
<Route path="/admin/recruit/:recruitId" element={<AdminRecruitContent />} />
<Route path="/admin/password" element={<ModifyPassword />} />
</Routes>
<Footer />
Expand Down Expand Up @@ -125,6 +127,7 @@ function App() {

<Route path="/admin/recruit" element={<AdminRecruitList />} />
<Route path="/admin/recruit/edit" element={<AdminRecruitWrite />} />
<Route path="/admin/recruit/:recruitId" element={<AdminRecruitContent />} />
<Route path="/admin/password" element={<ModifyPassword />} />
</Routes>

Expand Down
14 changes: 9 additions & 5 deletions src/component/admin/AdminIntroductionpage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ export default function AdminIntroductionPage({
department,
introduction,
instagram,
//imgUrl,
leader,
activity,
room,
Expand All @@ -27,7 +26,7 @@ export default function AdminIntroductionPage({
const NewLines = ({ text }) => {
return <div>{handleNewLines(text)}</div>;
};

console.log(activity);
return (
<>
<div className={styles.detailBody}>
Expand All @@ -42,9 +41,14 @@ export default function AdminIntroductionPage({
<p className={styles.p_style}>{introduction}</p>
<br></br>
<strong>📌 인스타</strong>
<a href={instagram} target="_blank" rel="noopener noreferrer">
<img className={styles.InstaIcon} src="/buttons/instagram_icon.png" alt="instagram" />
</a>
{instagram !== null ? (
<a href={instagram} target="_blank" rel="noopener noreferrer">
<img className={styles.InstaIcon} src="/buttons/instagram_icon.png" alt="instagram" />
</a>
) : (
''
)}

<br></br>
<strong>📌 대표 활동</strong>
<p className={styles.p_style}>
Expand Down
Loading

0 comments on commit cd8ff87

Please sign in to comment.