Skip to content

Commit

Permalink
어플리
Browse files Browse the repository at this point in the history
  • Loading branch information
Dom1046 committed Dec 3, 2024
1 parent 64dd964 commit bade9e0
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 2 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,41 @@ jobs:
with:
distribution: 'zulu'
java-version: '17'

- run: touch ./src/main/resources/application.properties
- run: echo "${{secrets.MALLANG_APPLICATION}}" > ./src/main/resources/application.properties

- uses: actions/upload-artifact@v3
with:
name: application.properties
path: ./src/main/resources/application.properties

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

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

# 현재 시간 가져오기
- name: Get current time
uses: josStorer/get-current-time@v2
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.MALLANG_ACCESS_KEY}}
aws_secret_key: ${{secrets.MALLANG_SECRET_KEY}}
application_name: Mallangs2-two
environment_name: Mallangs2-two-env
version_label: github-action-${{steps.current-time.outputs.formattedTime}}
region: ap-northeast-2
deployment_package: ./build/libs/${{env.artifact}}
2 changes: 1 addition & 1 deletion src/main/java/com/mallangs/global/config/MvcConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/**") // 모든 경로에 대해 CORS 허용
.allowedOrigins("http://localhost:8080")
.allowedOrigins("http://localhost:5173")
.allowedOrigins("3.36.165.216")
.allowedOrigins("3.36.165.216:8080")
.allowedOrigins("http://localhost:3000", "https://*.ngrok-free.app") // 허용할 도메인
.allowedMethods("GET", "POST", "PUT", "DELETE", "OPTIONS") // 허용할 HTTP 메서드
.allowedHeaders("*") // 허용할 헤더
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public SecurityFilterChain defaultSecurityFilterChain(HttpSecurity http) throws
.cors(corsCustomizer -> corsCustomizer.configurationSource(request -> {
CorsConfiguration configuration = new CorsConfiguration();
configuration.setAllowedOrigins(Arrays.asList("http://localhost:3000", "http://localhost:8080",
"http://localhost:5173", "https://*.ngrok-free.app", "3.36.165.216"));
"http://localhost:5173", "https://*.ngrok-free.app", "3.36.165.216:8080/"));
configuration.setAllowedMethods(Collections.singletonList("*"));
configuration.setAllowCredentials(true);
configuration.setAllowedHeaders(Collections.singletonList("*"));
Expand Down

0 comments on commit bade9e0

Please sign in to comment.