From 02e81387f2adaceeb935adb12ee43cd93644f6df Mon Sep 17 00:00:00 2001 From: sujata-m Date: Tue, 11 Feb 2025 14:03:24 +0530 Subject: [PATCH 1/2] Fixed Issue-1704 - Fixed Issue-[1704](https://dev.azure.com/TDEI-UW/TDEI/_workitems/edit/1704) - Enabled the dev and stage pipeline --- .github/workflows/dev_workflow.yaml | 34 ++++++------- .github/workflows/stage_workflow.yaml | 72 +++++++++++++-------------- 2 files changed, 53 insertions(+), 53 deletions(-) diff --git a/.github/workflows/dev_workflow.yaml b/.github/workflows/dev_workflow.yaml index 3daa171..b0089a6 100644 --- a/.github/workflows/dev_workflow.yaml +++ b/.github/workflows/dev_workflow.yaml @@ -1,6 +1,6 @@ on: pull_request: - branches: [dev] + branches: [ dev ] types: - closed workflow_dispatch: @@ -20,21 +20,21 @@ jobs: run: | docker build -t ${{ secrets.REGISTRY_DOMAIN }}/${{ secrets.REGISTRY_REPO }}:${{ github.sha }} -t ${{ secrets.REGISTRY_DOMAIN }}/${{ secrets.REGISTRY_REPO }}:${{ github.ref_name == 'main' && 'prod' || github.ref_name }}${{ github.ref_name != 'main' && '-latest' || 'latest' }} . docker push ${{ secrets.REGISTRY_DOMAIN }}/${{ secrets.REGISTRY_REPO }} --all-tags - # This is done as Container Instance - # Deploy: - # needs: Build - # environment: - # name: Development - # runs-on: ubuntu-latest - # steps: - # - name: Login to Azure - # uses: azure/login@v1 - # with: - # creds: ${{ secrets.TDEI_CORE_AZURE_CREDS }} - # - name: Deploy to Dev - # uses: azure/webapps-deploy@v2 - # with: - # app-name: ${{ secrets.AZURE_WEBAPP_NAME }} - # images: ${{ secrets.REGISTRY_DOMAIN }}/${{ secrets.REGISTRY_REPO }}:${{ github.sha }} + # This is done as Container Instance + Deploy: + needs: Build + environment: + name: Development + runs-on: ubuntu-latest + steps: + - name: Login to Azure + uses: azure/login@v1 + with: + creds: ${{ secrets.TDEI_CORE_AZURE_CREDS }} + - name: Deploy to Dev + uses: azure/webapps-deploy@v2 + with: + app-name: ${{ secrets.AZURE_WEBAPP_NAME }} + images: ${{ secrets.REGISTRY_DOMAIN }}/${{ secrets.REGISTRY_REPO }}:${{ github.sha }} diff --git a/.github/workflows/stage_workflow.yaml b/.github/workflows/stage_workflow.yaml index 8f70225..3081f08 100644 --- a/.github/workflows/stage_workflow.yaml +++ b/.github/workflows/stage_workflow.yaml @@ -1,41 +1,41 @@ on: - pull_request: - branches: [stage] - types: - - closed - workflow_dispatch: + pull_request: + branches: [ stage ] + types: + - closed + workflow_dispatch: jobs: - Build: - environment: Stage - runs-on: ubuntu-latest - if: github.event.pull_request.merged == true - steps: - - uses: actions/checkout@v2 - - uses: azure/docker-login@v1 - with: - login-server: ${{secrets.REGISTRY_DOMAIN}} - username: ${{secrets.REGISTRY_USERNAME}} - password: ${{secrets.REGISTRY_PASSWORD}} - - name: Publish image to Azure Registrty - run: | - docker build -t ${{ secrets.REGISTRY_DOMAIN }}/${{ secrets.REGISTRY_REPO }}:${{ github.sha }} -t ${{ secrets.REGISTRY_DOMAIN }}/${{ secrets.REGISTRY_REPO }}:${{ github.ref_name == 'main' && 'prod' || github.ref_name }}${{ github.ref_name != 'main' && '-latest' || 'latest' }} . - docker push ${{ secrets.REGISTRY_DOMAIN }}/${{ secrets.REGISTRY_REPO }} --all-tags - # This is done as Container Instance - # Deploy: - # needs: Build - # environment: - # name: Stage - # runs-on: ubuntu-latest - # steps: - # - name: Login to Azure - # uses: azure/login@v1 - # with: - # creds: ${{ secrets.TDEI_CORE_AZURE_CREDS }} - # - name: Deploy to Dev - # uses: azure/webapps-deploy@v2 - # with: - # app-name: ${{ secrets.AZURE_WEBAPP_NAME }} - # images: ${{ secrets.REGISTRY_DOMAIN }}/${{ secrets.REGISTRY_REPO }}:${{ github.sha }} + Build: + environment: Stage + runs-on: ubuntu-latest + if: github.event.pull_request.merged == true + steps: + - uses: actions/checkout@v2 + - uses: azure/docker-login@v1 + with: + login-server: ${{secrets.REGISTRY_DOMAIN}} + username: ${{secrets.REGISTRY_USERNAME}} + password: ${{secrets.REGISTRY_PASSWORD}} + - name: Publish image to Azure Registrty + run: | + docker build -t ${{ secrets.REGISTRY_DOMAIN }}/${{ secrets.REGISTRY_REPO }}:${{ github.sha }} -t ${{ secrets.REGISTRY_DOMAIN }}/${{ secrets.REGISTRY_REPO }}:${{ github.ref_name == 'main' && 'prod' || github.ref_name }}${{ github.ref_name != 'main' && '-latest' || 'latest' }} . + docker push ${{ secrets.REGISTRY_DOMAIN }}/${{ secrets.REGISTRY_REPO }} --all-tags + # This is done as Container Instance + Deploy: + needs: Build + environment: + name: Stage + runs-on: ubuntu-latest + steps: + - name: Login to Azure + uses: azure/login@v1 + with: + creds: ${{ secrets.TDEI_CORE_AZURE_CREDS }} + - name: Deploy to Dev + uses: azure/webapps-deploy@v2 + with: + app-name: ${{ secrets.AZURE_WEBAPP_NAME }} + images: ${{ secrets.REGISTRY_DOMAIN }}/${{ secrets.REGISTRY_REPO }}:${{ github.sha }} \ No newline at end of file From 953eb6d5056141ca6128d4c7c7b27099e533d183 Mon Sep 17 00:00:00 2001 From: sujata-m Date: Tue, 11 Feb 2025 14:06:39 +0530 Subject: [PATCH 2/2] Fixed indentation --- .github/workflows/dev_workflow.yaml | 35 +++++++------ .github/workflows/stage_workflow.yaml | 72 +++++++++++++-------------- 2 files changed, 53 insertions(+), 54 deletions(-) diff --git a/.github/workflows/dev_workflow.yaml b/.github/workflows/dev_workflow.yaml index b0089a6..e591c71 100644 --- a/.github/workflows/dev_workflow.yaml +++ b/.github/workflows/dev_workflow.yaml @@ -1,6 +1,6 @@ on: pull_request: - branches: [ dev ] + branches: [dev] types: - closed workflow_dispatch: @@ -20,21 +20,20 @@ jobs: run: | docker build -t ${{ secrets.REGISTRY_DOMAIN }}/${{ secrets.REGISTRY_REPO }}:${{ github.sha }} -t ${{ secrets.REGISTRY_DOMAIN }}/${{ secrets.REGISTRY_REPO }}:${{ github.ref_name == 'main' && 'prod' || github.ref_name }}${{ github.ref_name != 'main' && '-latest' || 'latest' }} . docker push ${{ secrets.REGISTRY_DOMAIN }}/${{ secrets.REGISTRY_REPO }} --all-tags - # This is done as Container Instance + # This is done as Container Instance Deploy: - needs: Build - environment: - name: Development - runs-on: ubuntu-latest - steps: - - name: Login to Azure - uses: azure/login@v1 - with: - creds: ${{ secrets.TDEI_CORE_AZURE_CREDS }} - - name: Deploy to Dev - uses: azure/webapps-deploy@v2 - with: - app-name: ${{ secrets.AZURE_WEBAPP_NAME }} - images: ${{ secrets.REGISTRY_DOMAIN }}/${{ secrets.REGISTRY_REPO }}:${{ github.sha }} - - + needs: Build + environment: + name: Development + runs-on: ubuntu-latest + steps: + - name: Login to Azure + uses: azure/login@v1 + with: + creds: ${{ secrets.TDEI_CORE_AZURE_CREDS }} + - name: Deploy to Dev + uses: azure/webapps-deploy@v2 + with: + app-name: ${{ secrets.AZURE_WEBAPP_NAME }} + images: ${{ secrets.REGISTRY_DOMAIN }}/${{ secrets.REGISTRY_REPO }}:${{ github.sha }} + diff --git a/.github/workflows/stage_workflow.yaml b/.github/workflows/stage_workflow.yaml index 3081f08..65547b1 100644 --- a/.github/workflows/stage_workflow.yaml +++ b/.github/workflows/stage_workflow.yaml @@ -1,41 +1,41 @@ on: - pull_request: - branches: [ stage ] - types: - - closed - workflow_dispatch: + pull_request: + branches: [stage] + types: + - closed + workflow_dispatch: jobs: - Build: - environment: Stage - runs-on: ubuntu-latest - if: github.event.pull_request.merged == true - steps: - - uses: actions/checkout@v2 - - uses: azure/docker-login@v1 - with: - login-server: ${{secrets.REGISTRY_DOMAIN}} - username: ${{secrets.REGISTRY_USERNAME}} - password: ${{secrets.REGISTRY_PASSWORD}} - - name: Publish image to Azure Registrty - run: | - docker build -t ${{ secrets.REGISTRY_DOMAIN }}/${{ secrets.REGISTRY_REPO }}:${{ github.sha }} -t ${{ secrets.REGISTRY_DOMAIN }}/${{ secrets.REGISTRY_REPO }}:${{ github.ref_name == 'main' && 'prod' || github.ref_name }}${{ github.ref_name != 'main' && '-latest' || 'latest' }} . - docker push ${{ secrets.REGISTRY_DOMAIN }}/${{ secrets.REGISTRY_REPO }} --all-tags - # This is done as Container Instance - Deploy: - needs: Build - environment: - name: Stage - runs-on: ubuntu-latest - steps: - - name: Login to Azure - uses: azure/login@v1 - with: - creds: ${{ secrets.TDEI_CORE_AZURE_CREDS }} - - name: Deploy to Dev - uses: azure/webapps-deploy@v2 - with: - app-name: ${{ secrets.AZURE_WEBAPP_NAME }} - images: ${{ secrets.REGISTRY_DOMAIN }}/${{ secrets.REGISTRY_REPO }}:${{ github.sha }} + Build: + environment: Stage + runs-on: ubuntu-latest + if: github.event.pull_request.merged == true + steps: + - uses: actions/checkout@v2 + - uses: azure/docker-login@v1 + with: + login-server: ${{secrets.REGISTRY_DOMAIN}} + username: ${{secrets.REGISTRY_USERNAME}} + password: ${{secrets.REGISTRY_PASSWORD}} + - name: Publish image to Azure Registrty + run: | + docker build -t ${{ secrets.REGISTRY_DOMAIN }}/${{ secrets.REGISTRY_REPO }}:${{ github.sha }} -t ${{ secrets.REGISTRY_DOMAIN }}/${{ secrets.REGISTRY_REPO }}:${{ github.ref_name == 'main' && 'prod' || github.ref_name }}${{ github.ref_name != 'main' && '-latest' || 'latest' }} . + docker push ${{ secrets.REGISTRY_DOMAIN }}/${{ secrets.REGISTRY_REPO }} --all-tags + # This is done as Container Instance + Deploy: + needs: Build + environment: + name: Stage + runs-on: ubuntu-latest + steps: + - name: Login to Azure + uses: azure/login@v1 + with: + creds: ${{ secrets.TDEI_CORE_AZURE_CREDS }} + - name: Deploy to Dev + uses: azure/webapps-deploy@v2 + with: + app-name: ${{ secrets.AZURE_WEBAPP_NAME }} + images: ${{ secrets.REGISTRY_DOMAIN }}/${{ secrets.REGISTRY_REPO }}:${{ github.sha }} \ No newline at end of file