From 8181cb53378e3aa92f8821a2d519afc11dab0f1e Mon Sep 17 00:00:00 2001 From: Jiyoon Kim Date: Thu, 11 Jan 2024 19:11:39 +0900 Subject: [PATCH] =?UTF-8?q?#3=20feat:=20elastic=20beanstalk=20=ED=99=98?= =?UTF-8?q?=EA=B2=BD=20=EC=97=B0=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/deploy.yml | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 53514de5..35507396 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -29,7 +29,7 @@ jobs: with: character set server: 'utf8' mysql database: 'trip' - mysql user: 'hdy' + mysql user: 'kjy' mysql password: ${{ secrets.MYSQL_PASSWORD }} - name: Grant execute permission for gradlew @@ -38,4 +38,31 @@ jobs: - name: Build with Gradle run: ./gradlew clean build - shell: bash \ No newline at end of file + 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" + + - 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 . + + - name: Beanstalk Deploy + uses: einaregilsson/beanstalk-deploy@v21 + with: + aws_access_key: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws_secret_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + application_name: how-about-trip + environment_name: How-about-trip-env + version_label: github-action-${{steps.current-time.outputs.formattedTime}} + region: ap-northeast-2 + deployment_package: deploy/deploy.zip