Skip to content

refactor: event - collect stamps #110

refactor: event - collect stamps

refactor: event - collect stamps #110

name: ddingdong-dev-depoly
on:
push:
branches:
- develop # develop에 push될 때 실행
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up JDK 17
uses: actions/setup-java@v1
with:
java-version: 17
- name: Set yaml file
uses: microsoft/variable-substitution@v1
with:
files: ./src/main/resources/application.yml
env:
spring.datasource.url: ${{secrets.DB_URL}}
spring.datasource.username: ${{secrets.DB_USERNAME}}
spring.datasource.password: ${{secrets.DB_PASSWORD}}
spring.s3.bucket: ${{secrets.BUCKET_NAME}}
sprig.s3.access-key: ${{secrets.AWS_ACCESS_KEY_ID}}
sprig.s3.secret-key: ${{secrets.AWS_SECRET_ACCESS_KEY}}
cloud.aws.region.static: ${{secrets.AWS_DEFAULT_REGION}}
jwt.secret: ${{secrets.JWT_SECRET}}
- name: Grant execute permission for gradlew
run: chmod +x ./gradlew
shell: bash
- name: Build with Gradle
run: ./gradlew clean build
shell: bash
- name: Get current time
uses: 1466587594/get-current-time@v2
id: current-time
with:
format: YYYY-MM-DDTHH-mm-ss
utcOffset: "+09:00" # 한국 시간에 맞추기 위함
# grandle build를 통해 만들어진 jar를 beanstalk에 배포하기 위한 zip 파일로 만드는 것
- name: Generate deployment package
run: |
mkdir -p deploy
cp build/libs/*.jar deploy/application.jar
cp Procfile deploy/Procfile
cp -r .ebextensions deploy/.ebextensions
cp -r .platform deploy/.platform
cd deploy && zip -r deploy.zip .
# Beanstalk Deploy 플러그인 사용
- name: Beanstalk Deploy
uses: einaregilsson/beanstalk-deploy@v21
with:
aws_access_key: ${{ secrets.AWS_ACCESS_KEY_ID }} # github secrets로 등록한 값 사용
aws_secret_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} # github secrets로 등록한 값 사용
application_name: ddingdong-dev # EB application 이름
environment_name: ddingdong-dev-env # EB environment 이름
version_label: Github Action-${{steps.current-time.outputs.formattedTime}} # 배포 버전은 타임스탬프를 이용하여 구분
region: ap-northeast-2
deployment_package: deploy/deploy.zip
wait_for_environment_recovery: 180
- name: Test with Gradle
run: ./gradlew test --no-daemon
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
file: ./build/reports/jacoco/test/jacocoTestReport.xml