Skip to content

Commit d9d1f96

Browse files
committed
[FEATURE] Github Action 을 통한 CI/CD 구축 (#70)
* chore: gradle 빌드 세팅 수정 (#69) * chore: docker compose 세팅 (#69) * feat: create sql 문 (#69) * refactor: insert sql 문 (#69) * feat: Github Action 을 통한 CI/CD 구축 (#69) * delete: 환경 변수 설정 삭제 (#69) * feat: Github Action 을 통한 CI/CD 구축 완료 (#69)
1 parent f8707dc commit d9d1f96

19 files changed

+199
-0
lines changed

.github/workflows/deploy.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Release CI/CD
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v3
15+
16+
- name: Set up JDK 17
17+
uses: actions/setup-java@v3
18+
with:
19+
distribution: 'corretto'
20+
java-version: '17'
21+
22+
- name: Grant execute permission for gradlew
23+
run: chmod +x gradlew
24+
25+
- name: Build with Gradle
26+
run: ./gradlew clean build
27+
28+
- name: Get current time
29+
uses: josStorer/[email protected]
30+
id: current-time
31+
with:
32+
format: YYYY-MM-DDTHH-mm-ss
33+
utcOffset: "+09:00"
34+
35+
- name: Set artifact
36+
run: echo "artifact=$(ls ./build/libs)" >> $GITHUB_ENV
37+
38+
- name: Beanstalk Deploy
39+
uses: einaregilsson/beanstalk-deploy@v20
40+
with:
41+
aws_access_key: ${{ secrets.AWS_ACCESS_KEY_ID }}
42+
aws_secret_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
43+
application_name: smunity
44+
environment_name: smunity-env
45+
version_label: github-action-${{steps.current-time.outputs.formattedTime}}
46+
region: ap-northeast-2
47+
deployment_package: ./build/libs/${{env.artifact}}

build.gradle

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ java {
1616
}
1717
}
1818

19+
jar {
20+
enabled = false
21+
}
22+
1923
configurations {
2024
compileOnly {
2125
extendsFrom annotationProcessor

docker-compose.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
version: '3'
2+
3+
services:
4+
redis:
5+
image: redis:latest
6+
container_name: smunity-redis
7+
ports:
8+
- "6379:6379"
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
create table common_department
2+
(
3+
department_id bigint auto_increment
4+
primary key,
5+
college varchar(255) not null,
6+
name varchar(255) not null,
7+
type enum ('BALANCE_ART', 'BALANCE_BRIDGE', 'BALANCE_ENGINEER', 'BALANCE_HUMANITIES', 'BALANCE_NATURAL', 'BALANCE_NATURAL_ENGINEER', 'BALANCE_SOCIAL', 'BASIC_ACCIDENT', 'BASIC_COMPUTER', 'BASIC_COMPUTER_1', 'BASIC_COMPUTER_2', 'BASIC_ENG_MATH', 'CORE_CONVERGENCE', 'CORE_CREATIVE', 'CORE_DIVERSITY', 'CORE_ETHICAL', 'CORE_PROFESSIONAL') not null
8+
);
9+
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
create table common_member
2+
(
3+
member_id bigint auto_increment
4+
primary key,
5+
created_at datetime(6) null,
6+
updated_at datetime(6) null,
7+
email varchar(255) not null,
8+
name varchar(255) not null,
9+
password varchar(255) not null,
10+
role enum ('ROLE_ADMIN', 'ROLE_USER') null,
11+
username varchar(255) not null,
12+
department_id bigint null,
13+
year_id bigint null,
14+
constraint UKnukl4wikhup994cvb6stc4o37
15+
unique (username),
16+
constraint FK8hk760o00jjiko78mr1ge6vs9
17+
foreign key (year_id) references common_year (year_id),
18+
constraint FKq0jyek3fap9mfymxujtk4rlsx
19+
foreign key (department_id) references common_department (department_id)
20+
);
21+
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
create table common_year
2+
(
3+
year_id bigint auto_increment
4+
primary key,
5+
culture int null,
6+
culture_cnt int null,
7+
major_i int null,
8+
major_s int null,
9+
year_name varchar(255) not null,
10+
total int null,
11+
year_value int null
12+
);
13+
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
create table core_course
2+
(
3+
course_id bigint auto_increment
4+
primary key,
5+
category enum ('CULTURE', 'ETC', 'MAJOR_ADVANCED', 'MAJOR_OPTIONAL') not null,
6+
credit int not null,
7+
domain varchar(255) null,
8+
subject_name varchar(255) not null,
9+
subject_number varchar(8) not null,
10+
semester varchar(255) not null,
11+
sub_domain enum ('BALANCE_ART', 'BALANCE_BRIDGE', 'BALANCE_ENGINEER', 'BALANCE_HUMANITIES', 'BALANCE_NATURAL', 'BALANCE_NATURAL_ENGINEER', 'BALANCE_SOCIAL', 'BASIC_ACCIDENT', 'BASIC_COMPUTER', 'BASIC_COMPUTER_1', 'BASIC_COMPUTER_2', 'BASIC_ENG_MATH', 'CORE_CONVERGENCE', 'CORE_CREATIVE', 'CORE_DIVERSITY', 'CORE_ETHICAL', 'CORE_PROFESSIONAL') null,
12+
type varchar(255) not null,
13+
subject_year varchar(255) not null,
14+
member_id bigint null,
15+
constraint FKpmb6uj4m3s9o701125v933itu
16+
foreign key (member_id) references common_member (member_id)
17+
);
18+
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
create table core_curriculum
2+
(
3+
curriculum_id bigint auto_increment
4+
primary key,
5+
domain enum ('BALANCE', 'BASIC', 'CORE') not null,
6+
sub_domain enum ('BALANCE_ART', 'BALANCE_BRIDGE', 'BALANCE_ENGINEER', 'BALANCE_HUMANITIES', 'BALANCE_NATURAL', 'BALANCE_NATURAL_ENGINEER', 'BALANCE_SOCIAL', 'BASIC_ACCIDENT', 'BASIC_COMPUTER', 'BASIC_COMPUTER_1', 'BASIC_COMPUTER_2', 'BASIC_ENG_MATH', 'CORE_CONVERGENCE', 'CORE_CREATIVE', 'CORE_DIVERSITY', 'CORE_ETHICAL', 'CORE_PROFESSIONAL') not null,
7+
year_id bigint null,
8+
constraint FK6efpcybxp00n1ny29xpqm6p1d
9+
foreign key (year_id) references common_year (year_id)
10+
);
11+
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
create table core_standard
2+
(
3+
standard_id bigint auto_increment
4+
primary key,
5+
category enum ('CULTURE', 'ETC', 'MAJOR_ADVANCED', 'MAJOR_OPTIONAL') not null,
6+
total int not null,
7+
year_id bigint null,
8+
constraint FK86m3qbv3u8r3ii5us4jrk92kf
9+
foreign key (year_id) references common_year (year_id)
10+
);
11+
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
create table qna_answer
2+
(
3+
answer_id bigint auto_increment
4+
primary key,
5+
created_at datetime(6) null,
6+
updated_at datetime(6) null,
7+
content longtext not null,
8+
member_id bigint null,
9+
question_id bigint null,
10+
constraint UK8on2ssmkvwwg6ns24jq5v4kwr
11+
unique (question_id),
12+
constraint FKkuw8kdmsc09j21hmnv8ox1kus
13+
foreign key (question_id) references qna_question (question_id),
14+
constraint FKnl186rx460t55egnvi8vyb8i4
15+
foreign key (member_id) references common_member (member_id)
16+
);
17+

0 commit comments

Comments
 (0)