Skip to content

Commit

Permalink
[mod] yml로 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
DongWooKim4343 committed Dec 3, 2024
1 parent a28bc8b commit 417ac9e
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 19 deletions.
41 changes: 23 additions & 18 deletions .github/workflows/CICD.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@ on:

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

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

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

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

# application-secret.yml 파일 생성
- run: touch ./src/main/resources/application-secret.yml
- run: echo "${{ secrets.APPLICATION_SECRET }}" > ./src/main/resources/application-secret.yml

- name: Upload application.properties
uses: actions/upload-artifact@v3
# 생성된 파일들을 아티팩트로 업로드
- uses: actions/upload-artifact@v3
with:
name: application.properties
path: ./src/main/resources/application.properties
name: application-files
path: |
./src/main/resources/application.yml
./src/main/resources/application-secret.yml
- 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 +48,20 @@ 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 Green Environment
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 }}
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,8 @@ gradle-app.setting

# End of https://www.toptal.com/developers/gitignore/api/intellij,java,gradle,macos,windows
**/application.properties

**/application.yml
**/application-secret.yml
.env
logs/
**/generated/
Expand Down

0 comments on commit 417ac9e

Please sign in to comment.