Updated CI/CD Pipeline #61
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Frontend CI - Build & Push Image (Router) | ||
| on: | ||
| workflow_dispatch: | ||
| push: | ||
| branches: | ||
| - development | ||
| - main | ||
| paths: | ||
| - 'frontend/**' | ||
| - '.github/workflows/frontend_ci.yml' | ||
| pull_request: | ||
| branches: | ||
| - main | ||
| paths: | ||
| - 'frontend/**' | ||
| - '.github/workflows/frontend_ci.yml' | ||
| env: | ||
| ACR_LOGIN_SERVER: ${{ secrets.AZURE_CONTAINER_REGISTRY }} | ||
| IMAGE_TAG: ${{ github.sha }}-${{ github.run_id }} | ||
| jobs: | ||
| build_and_push_frontend: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
| - name: Azure Login | ||
| uses: azure/login@v1 | ||
| with: | ||
| creds: ${{ secrets.AZURE_CREDENTIALS }} | ||
| - name: Login to Azure Container Registry | ||
| run: az acr login --name ${{ env.ACR_LOGIN_SERVER }} | ||
| - name: Build and Push Frontend Image | ||
| run: | | ||
| docker build -t ${{ env.ACR_LOGIN_SERVER }}/frontend:latest ./frontend/ | ||
| docker push ${{ env.ACR_LOGIN_SERVER }}/frontend:latest | ||
| - name: Logout from Azure | ||
| run: az logout | ||
| if: always() | ||
| trigger_frontend_cd: | ||
| needs: build_and_push_frontend | ||
| if: github.ref == 'refs/heads/main' | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Trigger Frontend CD workflow | ||
| uses: ./.github/workflows/frontend-cd.yml | ||
| with: | ||
| product_api_ip: "20.92.168.148" | ||
| order_api_ip: "20.92.168.149" | ||
| aks_cluster_name: "ishaanAKS" | ||
| aks_resource_group: "deakinuni" | ||
| secrets: | ||
| azure_credentials: ${{ secrets.AZURE_CREDENTIALS }} | ||