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
43 changes: 43 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Build and Vercel Preview Deployment on Main
permissions:
contents: write

env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
VERCEL_ENV: preview

on:
push:
branches:
- main

workflow_dispatch:

jobs:
generate_tag:
uses: ./.github/workflows/headver-tagging.yml
with: {}

Deploy-Preview:
runs-on: ubuntu-latest
needs: generate_tag
env:
VERSION_TAG: ${{ needs.generate_tag.outputs.version }}
steps:
- uses: actions/checkout@v3

- name: Install Vercel CLI
run: npm install --global vercel@latest

- name: Pull Vercel Environment Information
run: vercel pull --yes --environment=${{ env.VERCEL_ENV }} --token=${{ secrets.VERCEL_TOKEN }}

- name: Build Project Artifacts
run: vercel build --yes --target=${{ env.VERCEL_ENV }} --token=${{ secrets.VERCEL_TOKEN }}

- name: Deploy Project Artifacts to Vercel
run: vercel deploy --prebuilt --target=${{ env.VERCEL_ENV }} --token=${{ secrets.VERCEL_TOKEN }}

- name: Output Tag Version
run: echo "Deployment completed for version $VERSION_TAG"
63 changes: 63 additions & 0 deletions .github/workflows/headver-tagging.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Generate HeadVer Tag
permissions:
contents: write

on:
workflow_call:
outputs:
version:
description: "Generated HeadVer version"
value: ${{ jobs.generate_tag.outputs.version }}

jobs:
generate_tag:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.compute_version.outputs.version }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Compute HeadVer Tag
id: compute_version
run: |
# headver.json에서 head 버전 가져오기
if [ ! -f headver.json ]; then
echo "headver.json 파일이 없습니다. 기본 head=0을 사용합니다."
HEAD=0
else
HEAD=$(jq -r '.head' headver.json)
fi
echo "Head number: $HEAD"

# 현재 연도와 주차(yyww) 가져오기
YYWW=$(date +"%y%V")
echo "YearWeek: $YYWW"

# 최신 태그 검색
LAST_BUILD=$(git tag --list "v*.*.*" | awk -F. '{print $3}' | sort -n | tail -n 1)

if [ -z "$LAST_BUILD" ]; then
BUILD=1
else
BUILD=$((LAST_BUILD + 1))
fi

echo "Build number: $BUILD"

# 최종 태그 생성
VERSION="${HEAD}.${YYWW}.${BUILD}"
echo "Computed version: $VERSION"

# GitHub Actions 환경 변수로 설정
echo "version=$VERSION" >> $GITHUB_ENV
echo "::set-output name=version::$VERSION"

- name: Create Tag
run: |
TAG="v${{ steps.compute_version.outputs.version }}"
echo "Creating tag: $TAG"

git tag $TAG
git push origin $TAG
3 changes: 3 additions & 0 deletions headver.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"head": 22
}
52 changes: 1 addition & 51 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
"react": "^18",
"react-dom": "^18",
"react-linkify": "^1.0.0-alpha",
"react-slick": "^0.30.1",
"slick-carousel": "^1.8.1"
},
"devDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions src/app/application/apply/LanguageStep.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import BlockBtn from "@/components/button/BlockBtn";
import Tab from "@/components/ui/Tab";

import { LanguageTestScore } from "@/types/score";
import { LanguageTestScore, languageTestMapping } from "@/types/score";

import ScoreCard from "@/app/score/ScoreCard";

Expand Down Expand Up @@ -31,7 +31,7 @@ const LanguageStep = ({
>
<ScoreCard
key={score.id}
name={score.languageTest.languageTestType}
name={languageTestMapping[score.languageTest.languageTestType]}
score={score.languageTest.languageTestScore}
status={score.verifyStatus}
// date={new Date(score.issueDate).toISOString()}
Expand Down
21 changes: 20 additions & 1 deletion src/app/application/apply/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ const ApplyPage = () => {
const [curGpaScore, setCurGpaScore] = useState<number | null>(null);
const [curUniversityList, setCurUniversityList] = useState<number[]>([]);

const [isSubmitting, setIsSubmitting] = useState<boolean>(false);

useEffect(() => {
const fetchAll = async () => {
try {
Expand All @@ -43,7 +45,21 @@ const ApplyPage = () => {
(score: LanguageTestScore) => score.verifyStatus === "APPROVED",
),
);
setUniversityList(universityRes.data);

// 대학명을 지역/나라, 대학명 가나다 순으로 정렬합니다
const sortedUniversityList = [...universityRes.data].sort((a, b) => {
// 1) region 비교
const regionCompare = a.region.localeCompare(b.region);
if (regionCompare !== 0) return regionCompare;

// 2) country 비교
const countryCompare = a.country.localeCompare(b.country);
if (countryCompare !== 0) return countryCompare;

// 3) 같은 region, country라면 대학명을 비교(가나다 순)
return a.koreanName.localeCompare(b.koreanName);
});
setUniversityList(sortedUniversityList);
} catch (err) {
if (err.response) {
console.error("Axios response error", err.response);
Expand Down Expand Up @@ -83,6 +99,7 @@ const ApplyPage = () => {
return;
}

setIsSubmitting(true); // TODO: 현재 임시 submit 처리, 이후에 통합 처리 추가
try {
await postApplicationApi({
gpaScoreId: curGpaScore,
Expand All @@ -96,6 +113,8 @@ const ApplyPage = () => {
setStep(99);
} catch (err) {
alert(err.response.data.message);
} finally {
setIsSubmitting(false);
}
};

Expand Down
70 changes: 0 additions & 70 deletions src/app/login/ImageCarousel.tsx

This file was deleted.

Loading
Loading