Skip to content

Commit

Permalink
[mod] 워크플로우 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
DongWooKim4343 committed Dec 3, 2024
1 parent 9b736b9 commit 7587cf0
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 25 deletions.
38 changes: 18 additions & 20 deletions .github/workflows/CICD.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
# 워크플로우의 이름 지정
name: CICD
name: CI/CD

on:
push:
branches:
- main
- 'feature/#123-feat-cicd'

jobs:
build:
# 실행 환경 지정
runs-on: ubuntu-latest

# 실행 스텝 지정
steps:
- uses: actions/checkout@v3

Expand All @@ -21,21 +17,20 @@ jobs:
distribution: 'zulu'
java-version: '17'

- name: Create application.yml
run: |
mkdir -p ./src/main/resources # 디렉토리가 없는 경우 생성
echo "${{ secrets.APPLICATION2 }}" | cat > ./src/main/resources/application.yml
# application.yml 파일 생성
- run: touch ./src/main/resources/application.properties
- run: echo "${{secrets.APPLICATION}}" > ./src/main/resources/application.properties

- name: Upload application.yml
uses: actions/upload-artifact@v3
# 생성된 파일들을 아티팩트로 업로드
- uses: actions/upload-artifact@v3
with:
name: application.yml
path: ./src/main/resources/application.yml
name: application.properties
path: ./src/main/resources/application.properties

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

- name: Build with Gradle (skip tests)
- name: Build with Gradle
run: ./gradlew clean build -x test

- name: Get current time
Expand All @@ -45,18 +40,21 @@ jobs:
format: YYYY-MM-DDTHH-mm-ss
utcOffset: "+09:00"

# 배포용 패키지 경로 저장
- name: Set artifact
run: echo "artifact=$(ls ./build/libs)" >> $GITHUB_ENV
# 배포용 패키지 경로 설정
- name: Set artifact path
run: |
artifact=$(ls ./build/libs/*.jar | head -n 1)
echo "artifact=$artifact" >> $GITHUB_ENV
# 빈스토크 배포
- name: Beanstalk Deploy
- name: Deploy to Elastic Beanstalk
uses: einaregilsson/beanstalk-deploy@v20
with:
aws_access_key: ${{ secrets.AWS_ACTION_ACCESS_KEY }}
aws_secret_key: ${{ secrets.AWS_ACTION_SECRET_ACCESS_KEY }}
application_name: mallangs-web
environment_name: Mallangs-web-env
version_label: github-action-${{ steps.current-time.outputs.formattedTime }}
version_label: github-action-${{ steps.current-time.outputs.time }}
region: ap-northeast-2
deployment_package: ./build/libs/${{ env.artifact }}
deployment_package: ${{ env.artifact }}

7 changes: 3 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,10 @@ dependencies {

implementation 'mysql:mysql-connector-java:8.0.33'

jar {
enabled = false
}
}

jar {
enabled = false
}
tasks.named('test') {
useJUnitPlatform()
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
@RequiredArgsConstructor
public class UploadUtil {

@Value("${edu.example.upload.path}")
@Value("${spring.web.resources.static-locations}")
private String uploadPath;

@PostConstruct
Expand Down

0 comments on commit 7587cf0

Please sign in to comment.