From a4460ecc7bc0f929f8893b65524e7b9f2e9b5c0e Mon Sep 17 00:00:00 2001 From: Bezsmertnyi Vladyslav <95479228+Vladik-gif@users.noreply.github.com> Date: Sun, 1 Sep 2024 10:54:00 +0300 Subject: [PATCH 1/3] Update deploy.yml --- .github/workflows/deploy.yml | 80 +++++++++--------------------------- 1 file changed, 19 insertions(+), 61 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 71449184..1ad566a8 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -1,71 +1,29 @@ -name: CI-CD-Pipeline-to-AWS +name: Build CI + on: - push: - branches: - - master - - develop pull_request: - branches: - - master - - develop + branches: ['dev_v4'] -env: - AWS_REGION: eu-central-1 - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - EB_APP_NAME: chat-app - EB_ENV_NAME: Chat-app-env - JAVA_VERSION: '17' - JAR_FILE: chatYourWay-0.0.1-SNAPSHOT.jar - VERSION_LABEL: chat_${{ github.sha }} +permissions: + contents: read jobs: build: - name: Build - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v1 - - - name: Set up JDK - uses: actions/setup-java@v1 - with: - java-version: ${{ env.JAVA_VERSION }} - - - name: Build with Maven - run: mvn -B package --file pom.xml + runs-on: ubuntu-20.04 - - name: Upload JAR - uses: actions/upload-artifact@v2 - with: - name: artifact - path: target/${{ env.JAR_FILE }} - - - name: Print finished building - run: echo "The app building finished successfully!" - - deploy: - needs: build - if: github.event_name != 'pull_request' - name: Deploy - runs-on: ubuntu-latest steps: - - name: Download JAR - uses: actions/download-artifact@v2 - with: - name: artifact + - uses: actions/checkout@v3 + + - name: Set up JDK 17 + uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'adopt' + architecture: x64 + cache: 'maven' - - name: Deploy to EB - uses: einaregilsson/beanstalk-deploy@v13 - with: - aws_access_key: ${{ env.AWS_ACCESS_KEY_ID }} - aws_secret_key: ${{ env.AWS_SECRET_ACCESS_KEY }} - use_existing_version_if_available: false - application_name: ${{ env.EB_APP_NAME }} - environment_name: ${{ env.EB_ENV_NAME }} - version_label: ${{ env.VERSION_LABEL }} - region: ${{ env.AWS_REGION }} - deployment_package: ${{ env.JAR_FILE }} + - name: Build with Maven + run: mvn clean install - - name: Print finished deployment - run: echo "Deployment completed successfully!" \ No newline at end of file + - name: Finalize Build + run: echo "Build completed successfully!" From 7df60d6d3922c1a17dcd64807b954573e8f17d0b Mon Sep 17 00:00:00 2001 From: Bezsmertnyi Vladyslav <95479228+Vladik-gif@users.noreply.github.com> Date: Sun, 1 Sep 2024 10:57:26 +0300 Subject: [PATCH 2/3] Update deploy.yml --- .github/workflows/deploy.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 1ad566a8..91ffd480 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -1,8 +1,9 @@ name: Build CI on: - pull_request: - branches: ['dev_v4'] + push: + branches: + - dev_v4 permissions: contents: read From 08a5be9543392fbe41f9e9dab597fd449b0c1cd3 Mon Sep 17 00:00:00 2001 From: Bezsmertnyi Vladyslav <95479228+Vladik-gif@users.noreply.github.com> Date: Mon, 2 Sep 2024 09:36:41 +0300 Subject: [PATCH 3/3] Update deploy.yml --- .github/workflows/deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 91ffd480..fdc1be24 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -3,7 +3,7 @@ name: Build CI on: push: branches: - - dev_v4 + - v3 permissions: contents: read