Skip to content

Commit

Permalink
Show popo version (#55)
Browse files Browse the repository at this point in the history
  • Loading branch information
BlueHorn07 authored Oct 27, 2023
1 parent bc4e008 commit e7c7892
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 16 deletions.
4 changes: 4 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,8 @@
node_modules

.env
.env.example
.github
README.md

nginx/
13 changes: 7 additions & 6 deletions .github/workflows/github-action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,21 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v3
with:
platforms: 'arm64' # support AWS EC2 t4g
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v2
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ap-northeast-2
- name: Login to Amazon ECR
uses: aws-actions/amazon-ecr-login@v1
uses: aws-actions/amazon-ecr-login@v2
- name: Determine Prod/Dev Stage
run: |
if [[ ${{ github.event_name }} == 'release' ]]; then
Expand All @@ -42,13 +42,14 @@ jobs:
echo "NEXT_PUBLIC_ENV=dev" >> $GITHUB_ENV
fi
- name: Build and Push
uses: docker/build-push-action@v3
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/arm64 # support AWS EC2 t4g
tags: ${{ env.ECR_REGISTRY }}/${{ env.ECR_REPOSITORY }}:${{ env.IMAGE_TAG }}
build-args: |
"NEXT_PUBLIC_ENV=${{ env.NEXT_PUBLIC_ENV }}"
"POPO_VERSION=${{ github.event.release.tag_name || github.sha }}"
cache-from: type=gha
cache-to: type=gha,mode=max
push: true
Expand Down
14 changes: 9 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
# Buile Step
FROM node:18.18-alpine AS builder

# dev, prod
ARG NEXT_PUBLIC_ENV
ENV NEXT_PUBLIC_ENV ${NEXT_PUBLIC_ENV}

WORKDIR /usr/src/app

COPY package*.json ./
Expand All @@ -13,11 +9,19 @@ RUN npm ci --ignore-scripts --legacy-peer-deps

COPY . .

# dev, prod
ARG NEXT_PUBLIC_ENV
ENV NEXT_PUBLIC_ENV ${NEXT_PUBLIC_ENV}

# popo version
ARG POPO_VERSION
ENV NEXT_PUBLIC_POPO_VERSION ${POPO_VERSION}

RUN npm run build
RUN npm prune --production

# Run Step
FROM node:18.17-alpine AS runner
FROM node:18.18-alpine AS runner

WORKDIR /usr/src/app

Expand Down
8 changes: 7 additions & 1 deletion components/navbar/menu.item.user.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,13 @@ const MenuItemUser = () => {
border: 'none',
boxShadow: '0 2px 5px 0px rgba(0, 0, 0, 0.2)',
}}>
<Dropdown.Item text={'로그아웃'} onClick={handleLogout}/>
<Dropdown.Item
text={'로그아웃'}
onClick={handleLogout}
/>
<Dropdown.Item
text={`popo-${process.env.NEXT_PUBLIC_POPO_VERSION}`}
/>
</Dropdown.Menu>
</Dropdown>
</Menu.Item>
Expand Down
5 changes: 1 addition & 4 deletions pages/login.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useState } from 'react'
import { useRouter } from 'next/router'
import { Form, Image, Message } from 'semantic-ui-react'
import { Form, Image } from 'semantic-ui-react'
import styled from 'styled-components'

import LoginLayout from '@/components/layout.raw'
Expand Down Expand Up @@ -34,9 +34,6 @@ const LoginPage = () => {
<SubTitle>관리자 페이지</SubTitle>

<LoginFormDiv>
<Message>
2023.08.13부터 POPO 로그인 방식이 ID/PW에서 Email/PW로 변경 됩니다.
</Message>
<Form>
<Form.Input
required
Expand Down

0 comments on commit e7c7892

Please sign in to comment.