Skip to content

Commit

Permalink
[FEATURE] Github Action 을 통한 CI/CD 구축 (#70)
Browse files Browse the repository at this point in the history
* 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)
  • Loading branch information
hyunmin0317 authored Oct 4, 2024
1 parent 52f8a91 commit d1c2c5f
Show file tree
Hide file tree
Showing 19 changed files with 199 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Release CI/CD

on:
push:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest

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

- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'corretto'
java-version: '17'

- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Build with Gradle
run: ./gradlew clean build

- name: Get current time
uses: josStorer/[email protected]
id: current-time
with:
format: YYYY-MM-DDTHH-mm-ss
utcOffset: "+09:00"

- name: Set artifact
run: echo "artifact=$(ls ./build/libs)" >> $GITHUB_ENV

- name: Beanstalk Deploy
uses: einaregilsson/beanstalk-deploy@v20
with:
aws_access_key: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws_secret_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
application_name: smunity
environment_name: smunity-env
version_label: github-action-${{steps.current-time.outputs.formattedTime}}
region: ap-northeast-2
deployment_package: ./build/libs/${{env.artifact}}
4 changes: 4 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ java {
}
}

jar {
enabled = false
}

configurations {
compileOnly {
extendsFrom annotationProcessor
Expand Down
8 changes: 8 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: '3'

services:
redis:
image: redis:latest
container_name: smunity-redis
ports:
- "6379:6379"
9 changes: 9 additions & 0 deletions src/main/resources/sql/create/common_department.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
create table common_department
(
department_id bigint auto_increment
primary key,
college varchar(255) not null,
name varchar(255) not null,
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
);

21 changes: 21 additions & 0 deletions src/main/resources/sql/create/common_member.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
create table common_member
(
member_id bigint auto_increment
primary key,
created_at datetime(6) null,
updated_at datetime(6) null,
email varchar(255) not null,
name varchar(255) not null,
password varchar(255) not null,
role enum ('ROLE_ADMIN', 'ROLE_USER') null,
username varchar(255) not null,
department_id bigint null,
year_id bigint null,
constraint UKnukl4wikhup994cvb6stc4o37
unique (username),
constraint FK8hk760o00jjiko78mr1ge6vs9
foreign key (year_id) references common_year (year_id),
constraint FKq0jyek3fap9mfymxujtk4rlsx
foreign key (department_id) references common_department (department_id)
);

13 changes: 13 additions & 0 deletions src/main/resources/sql/create/common_year.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
create table common_year
(
year_id bigint auto_increment
primary key,
culture int null,
culture_cnt int null,
major_i int null,
major_s int null,
year_name varchar(255) not null,
total int null,
year_value int null
);

18 changes: 18 additions & 0 deletions src/main/resources/sql/create/core_course.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
create table core_course
(
course_id bigint auto_increment
primary key,
category enum ('CULTURE', 'ETC', 'MAJOR_ADVANCED', 'MAJOR_OPTIONAL') not null,
credit int not null,
domain varchar(255) null,
subject_name varchar(255) not null,
subject_number varchar(8) not null,
semester varchar(255) not null,
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,
type varchar(255) not null,
subject_year varchar(255) not null,
member_id bigint null,
constraint FKpmb6uj4m3s9o701125v933itu
foreign key (member_id) references common_member (member_id)
);

11 changes: 11 additions & 0 deletions src/main/resources/sql/create/core_curriculum.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
create table core_curriculum
(
curriculum_id bigint auto_increment
primary key,
domain enum ('BALANCE', 'BASIC', 'CORE') not null,
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,
year_id bigint null,
constraint FK6efpcybxp00n1ny29xpqm6p1d
foreign key (year_id) references common_year (year_id)
);

11 changes: 11 additions & 0 deletions src/main/resources/sql/create/core_standard.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
create table core_standard
(
standard_id bigint auto_increment
primary key,
category enum ('CULTURE', 'ETC', 'MAJOR_ADVANCED', 'MAJOR_OPTIONAL') not null,
total int not null,
year_id bigint null,
constraint FK86m3qbv3u8r3ii5us4jrk92kf
foreign key (year_id) references common_year (year_id)
);

17 changes: 17 additions & 0 deletions src/main/resources/sql/create/qna_answer.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
create table qna_answer
(
answer_id bigint auto_increment
primary key,
created_at datetime(6) null,
updated_at datetime(6) null,
content longtext not null,
member_id bigint null,
question_id bigint null,
constraint UK8on2ssmkvwwg6ns24jq5v4kwr
unique (question_id),
constraint FKkuw8kdmsc09j21hmnv8ox1kus
foreign key (question_id) references qna_question (question_id),
constraint FKnl186rx460t55egnvi8vyb8i4
foreign key (member_id) references common_member (member_id)
);

14 changes: 14 additions & 0 deletions src/main/resources/sql/create/qna_question.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
create table qna_question
(
question_id bigint auto_increment
primary key,
created_at datetime(6) null,
updated_at datetime(6) null,
anonymous bit not null,
content longtext not null,
title varchar(255) not null,
member_id bigint null,
constraint FK1luni7huq5dib4ssoibwofk7b
foreign key (member_id) references common_member (member_id)
);

10 changes: 10 additions & 0 deletions src/main/resources/sql/create/subject_culture.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
create table subject_culture
(
culture_id bigint auto_increment
primary key,
credit int not null,
name varchar(255) not null,
number varchar(255) not null,
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
);

16 changes: 16 additions & 0 deletions src/main/resources/sql/create/subject_major.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
create table subject_major
(
major_id bigint auto_increment
primary key,
category enum ('CULTURE', 'ETC', 'MAJOR_ADVANCED', 'MAJOR_OPTIONAL') not null,
credit int not null,
grade enum ('ALL', 'FIRST', 'FOURTH', 'SECOND', 'THIRD') not null,
name varchar(255) not null,
number varchar(255) not null,
semester enum ('FIRST', 'SECOND') not null,
type varchar(255) not null,
department_id bigint not null,
constraint FKgh0dk1i0xbosxqa5k3qdqp4mg
foreign key (department_id) references common_department (department_id)
);

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit d1c2c5f

Please sign in to comment.