From 07d07c35ae2e0cc50b012972d6f67b53c4d87de7 Mon Sep 17 00:00:00 2001 From: KimSehoon <101192772+ki-met-hoon@users.noreply.github.com> Date: Sat, 17 Feb 2024 02:29:25 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20Elastic=20Beanstalk=20=EC=9E=90?= =?UTF-8?q?=EB=8F=99=20=EB=B0=B0=ED=8F=AC=20=EA=B8=B0=EB=8A=A5=EC=9D=84=20?= =?UTF-8?q?=EA=B0=80=EC=A7=84=20deploy-to-aws-eb=20Action=20=EC=83=9D?= =?UTF-8?q?=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - workflow_dispatch를 통해 수동으로 배포 --- .github/workflows/deploy-to-aws-eb.yml | 57 ++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 .github/workflows/deploy-to-aws-eb.yml diff --git a/.github/workflows/deploy-to-aws-eb.yml b/.github/workflows/deploy-to-aws-eb.yml new file mode 100644 index 0000000..579fb2b --- /dev/null +++ b/.github/workflows/deploy-to-aws-eb.yml @@ -0,0 +1,57 @@ +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. +# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle + +name: Deploy to AWS EB + +on: + workflow_dispatch: + +permissions: + contents: read + +jobs: + build: + + runs-on: windows-latest + + steps: + - uses: actions/checkout@v3 + - name: Set up JDK 17 + uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'temurin' + - name: Build with Gradle + uses: gradle/gradle-build-action@67421db6bd0bf253fb4bd25b31ebb98943c375e1 + with: + arguments: clean build bootJar + + - name: Get current time + uses: 1466587594/get-current-time@v2 + id: current-time + with: + format: YYYYMMDDTHHmm + utcOffset: "+09:00" + + - name: Generate deployment package + run: | + mkdir -p deployment + cp build/libs/pnu-univ-miryang-campus-0.0.1-SNAPSHOT.jar deployment/pnu-univ-miryang-campus-0.0.1-SNAPSHOT.jar + cp deployment/Procfile deployment/Procfile + cd deployment && zip -r pnu-univ-miryang-campus-github-action-${{steps.current-time.outputs.formattedTime}} . + ls + + - name: Deploy Hello Github Action to EB + uses: einaregilsson/beanstalk-deploy@v14 + with: + aws_access_key: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws_secret_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + application_name: Pnu-Univ-Miryang-Campus + environment_name: Pnu-Univ-Miryang-Campus-env + version_label: pnu-univ-miryang-campus-github-action-${{steps.current-time.outputs.formattedTime}} + region: ap-northeast-2 + deployment_package: deployment/pnu-univ-miryang-campus-github-action-${{steps.current-time.outputs.formattedTime}}.zip