setting: PropertyConfig 추가 #48 #11
Workflow file for this run
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
name: Develop Branch CI | |
on: | |
push: | |
branches: [ "setting/#48" ] | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
# JDK 설정 | |
- uses: actions/checkout@v4 | |
- name: Set up JDK 21 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '21' | |
distribution: 'temurin' | |
# 환경 변수 파일 생성 | |
- name: Set environment values for main application | |
run: | | |
cd ./src/main/resources | |
touch ./env.properties | |
echo "${{ secrets.ENV }}" > ./env.properties | |
shell: bash | |
- name: Set environment values for test | |
run: | | |
cd ./src/test/resources | |
touch ./env.properties | |
echo "${{ secrets.TEST_ENV }}" > ./env.properties | |
shell: bash | |
# Gradle에 권한 부여 | |
- name: Grant execute permission for gradlew | |
run: chmod +x gradlew | |
# Gradle test | |
- name: Test with Gradle | |
run: ./gradlew test | |
# Gradle build | |
- name: Build Gradle | |
run: ./gradlew build | |
# 압축 파일 만들기 | |
- name: Make zip file | |
run: | | |
mkdir develop-deploy | |
cp ./src/main/resources/env.properties ./develop-deploy/.env | |
cp ./docker-compose.blue.yml ./develop-deploy/ | |
cp ./docker-compose.green.yml ./develop-deploy/ | |
cp ./appspec.yml ./develop-deploy/ | |
cp ./Dockerfile ./develop-deploy/ | |
cp ./scripts/*.sh ./develop-deploy/ | |
cp ./build/libs/*.jar ./develop-deploy/ | |
zip -r -qq -j ./munecting.zip ./develop-deploy | |
# AWS 접속 | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v1 | |
with: | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
aws-region: ap-northeast-2 | |
# S3에 저장 | |
- name: Upload to S3 | |
run: aws s3 cp --region ap-northeast-2 ./munecting.zip s3://develop-code-deploy-munecting | |
# Code Deploy 실행 | |
- name: Code Deploy | |
run: aws deploy create-deployment --application-name munecting-develop-deploy-origin | |
--deployment-config-name CodeDeployDefault.OneAtATime | |
--deployment-group-name munecting-develop-deploy-origin-group | |
--s3-location bucket=develop-code-deploy-munecting,bundleType=zip,key=munecting.zip |