From 3e4dbfd43a9d9aac7a67f40071d12e4c19c33169 Mon Sep 17 00:00:00 2001 From: Simeranjeet Sandhu Date: Mon, 26 Aug 2024 15:51:56 -0700 Subject: [PATCH] Adding xms2-ui workflow --- .github/workflows/cd-workflow.yml | 48 +++++++++++-------------------- 1 file changed, 17 insertions(+), 31 deletions(-) diff --git a/.github/workflows/cd-workflow.yml b/.github/workflows/cd-workflow.yml index 0800548..433554f 100644 --- a/.github/workflows/cd-workflow.yml +++ b/.github/workflows/cd-workflow.yml @@ -3,10 +3,10 @@ name: Docker CD on: push: branches: - - dev + - xms2-ui pull_request: branches: - - main + - xms2-ui types: [opened, synchronize, reopened] jobs: @@ -29,34 +29,20 @@ jobs: run: | yarn install - # - name: Generate Coverage Report - # env: - # GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }} - # run: | - # echo "Cloning private repository" - # git clone https://openlxp-host:${{ secrets.ACCESS_TOKEN }}@github.com/OpenLXP/openlxp-private.git - # echo "Private repository cloned successfully" - # echo "Copying .env file from openlxp-private to current working directory" - # cp ./openlxp-private/openlxp-xms-ui-env/.env . - # echo "Copied .env file successfully" - # echo "Create openlxp docker network" - # docker network create openlxp - # echo "Docker network successfully created" - # # yarn - # # yarn test --coverage + - name: Generate Coverage Report + env: + GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }} + run: | + echo "Cloning private repository" + git clone https://openlxp-host:${{ secrets.ACCESS_TOKEN }}@github.com/OpenLXP/openlxp-private.git + echo "Private repository cloned successfully" + echo "Copying .env file from openlxp-private to current working directory" + cp ./openlxp-private/openlxp-xms2-ui-env/.env . + echo "Copied .env file successfully" + echo "Create openlxp docker network" + docker network create openlxp + echo "Docker network successfully created" - # sonarcloud: - # name: SonarCloud - # runs-on: ubuntu-latest - # steps: - # - uses: actions/checkout@v2 - # with: - # fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis - # - name: SonarCloud Scan - # uses: SonarSource/sonarcloud-github-action@master - # env: - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any - # SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} build: # requires dependency from step above @@ -85,13 +71,13 @@ jobs: env: ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }} ECR_REPOSITORY: ${{ secrets.ECR_REPO }} - IMAGE_TAG: xmsui + IMAGE_TAG: xms2-ui run: | echo "Cloning private repository" git clone https://openlxp-host:${{ secrets.ACCESS_TOKEN }}@github.com/OpenLXP/openlxp-private.git echo "Private repository cloned successfully" echo "Copying .env file from openlxp-private to current working directory" - cp ./openlxp-private/openlxp-xms-ui-env/.env . + cp ./openlxp-private/openlxp-xms2-ui-env/.env . echo "Copied .env file successfully" echo "Starting docker build" docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG .