-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: 시큐리티 기본 설정 추가 * chore: src/main/resources/application.yml 삭제 및 gitignore 설정 * chore: Spring Actuator 의존성 추가 * chore: bootBuildImage 태스크 수정 * feat: 배포 파이프라인 추가 * fix: secrets 프로퍼티 이름 수정 * fix: distribution 설정 추가 * fix: 개행 제거 * fix: SSH 접속한 인스턴스에서 도커 스크립트를 실행하도록 수정 * fix: JVM 메모리 옵션 수정 * refactor: Kotlin DSL로 통일 * refactor: 중복된 task 제거 * chore: 적용 브랜치를 develop으로 변경
- Loading branch information
1 parent
55a5cc3
commit 5cf28dc
Showing
5 changed files
with
87 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
name: Deploy to Develop Environment | ||
|
||
on: | ||
push: | ||
branches: | ||
- develop | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup Java 17 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '17' | ||
distribution: 'adopt' | ||
|
||
- name: Update Git submodules | ||
run: git submodule update --remote --recursive | ||
|
||
- name: Build and test with Gradle | ||
run: ./gradlew test | ||
|
||
- name: Build and push Docker image | ||
run: ./gradlew clean bootBuildImage -PDOCKERHUB_ID=${{ secrets.DOCKERHUB_ID }} -PDOCKERHUB_TOKEN=${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: SSH into EC2 instance | ||
uses: appleboy/ssh-action@master | ||
with: | ||
host: ${{ secrets.DEV_EC2_HOST }} | ||
username: ${{ secrets.DEV_EC2_USERNAME }} | ||
key: ${{ secrets.DEV_EC2_PRIVATE_KEY }} | ||
port: ${{ secrets.DEV_EC2_SSH_PORT }} | ||
script: | | ||
docker pull mungmnb777/tteokguk:latest | ||
docker ps -f name=be-server -q | xargs --no-run-if-empty docker container stop | ||
docker ps -a -f name=be-server -q | xargs --no-run-if-empty docker container rm | ||
docker run -d --name be-server -p 80:8080 mungmnb777/tteokguk:latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,3 +41,6 @@ out/ | |
|
||
### VS Code ### | ||
.vscode/ | ||
|
||
### local properties ### | ||
/src/main/resources/application.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
src/main/java/com/tteokguk/tteokguk/global/security/SecurityConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package com.tteokguk.tteokguk.global.security; | ||
|
||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.security.config.annotation.web.builders.HttpSecurity; | ||
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; | ||
import org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer; | ||
import org.springframework.security.web.SecurityFilterChain; | ||
|
||
@Configuration | ||
@EnableWebSecurity | ||
public class SecurityConfig { | ||
|
||
@Bean | ||
public SecurityFilterChain filterChain(HttpSecurity http) throws Exception { | ||
return http | ||
.csrf(AbstractHttpConfigurer::disable) | ||
.formLogin(AbstractHttpConfigurer::disable) | ||
.build(); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.