Merge pull request #9 from dlgocks1/develop #27
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: dev Cocktaildakk BeanStalk CI/CD | |
on: | |
push: | |
branches: [ release ] | |
workflow_dispatch: # 수동 실행 옵션 (생략) | |
jobs: | |
build: | |
runs-on: ubuntu-latest # action 스크립트가 작동될 OS | |
steps: # 작업 단계 | |
- name: Checkout source code # 단계별 이름, 구분자로 소스를 가져옴 | |
uses: actions/checkout@v2 | |
- name: Setup JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
- name: Set Jasypt Password - Yml | |
uses: microsoft/variable-substitution@v1 | |
with: | |
files: ./Cocktaildakk-Common/src/main/resources/application-common.yml | |
env: | |
jasypt.encryptor.password: ${{ secrets.JASYPT_PASSWORD }} | |
- name: Grant execute permission for gradlew | |
run: chmod +x ./gradlew | |
shell: bash | |
- name: Build with Gradle | |
run: ./gradlew build -x test | |
shell: bash | |
- name: Get current time | |
uses: 1466587594/get-current-time@v2 | |
id: current-time | |
with: | |
format: YYYYMMDDTHHmm | |
utcOffset: "+09:00" | |
# gradle build를 통해 만들어진 jar 파일 beanstalk에 배포하기 위한 zip 파일로 만듬 | |
- name: Generate deployment package | |
run: | | |
mkdir -p deploy | |
cp Cocktaildakk-API/build/libs/*.jar deploy/cocktaildakk-dev.jar | |
cp Procfile deploy/Procfile | |
cp -r .ebextensions-dev deploy/.ebextensions | |
cp -r .platform deploy/.platform | |
cd deploy && zip -r cocktaildakk-dev-${{steps.current-time.outputs.formattedTime}}-${{github.sha}}.zip . | |
- name: Deploy Consumer to EB | |
uses: einaregilsson/beanstalk-deploy@v21 | |
with: | |
aws_access_key: ${{ secrets.AWS_ACCESS_KEY }} | |
aws_secret_key: ${{ secrets.AWS_SECRET_KEY }} | |
application_name: CocktaildakkDev | |
environment_name: CocktaildakkDev-env | |
version_label: cocktaildakk-dev-${{steps.current-time.outputs.formattedTime}}-${{github.sha}} | |
region: ap-northeast-2 | |
deployment_package: deploy/cocktaildakk-dev-${{steps.current-time.outputs.formattedTime}}-${{github.sha}}.zip | |
wait_for_deployment: false |