From 63ecb55ce1a141f8b73b69006675d1ffcce4a80f Mon Sep 17 00:00:00 2001 From: yxhwxn Date: Mon, 3 Jun 2024 02:37:31 +0900 Subject: [PATCH] =?UTF-8?q?Ci:=20dev=5Fdeploy.yml=20=EC=83=9D=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/dev_deploy.yml | 64 ++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 .github/workflows/dev_deploy.yml diff --git a/.github/workflows/dev_deploy.yml b/.github/workflows/dev_deploy.yml new file mode 100644 index 0000000..fd05246 --- /dev/null +++ b/.github/workflows/dev_deploy.yml @@ -0,0 +1,64 @@ +name: infoU dev CI/CD # Workflow 이름 + +on: + pull_request: + branches: + - dev + types: + - closed + workflow_dispatch: # 수동 실행도 가능하도록 + +jobs: + build: + runs-on: ubuntu-latest # OS 환경 세팅 + if: github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'dev' # PR이 Merge되고, base branch가 dev일 때만 실행 + + steps: + - name: Checkout + uses: actions/checkout@v2 # .github 디렉토리 하위 계층의 모든 코드 확인 + + # java 설치 + - name: Set up JDK 17 + uses: actions/setup-java@v3 + with: + distribution: 'adopt' + java-version: '17' + + # gradlew 실행 권한 부여 + - 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: YYYY-MM-DD HH:mm:ss + utcOffset: '+09:00' # build 시점의 시간을 기록 + + - name: Show current time + run: echo "Current time is ${{ steps.current-time.outputs.time }}" + shell: bash + + - 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@v20 + + + + + +