-
Notifications
You must be signed in to change notification settings - Fork 0
feat: add Application Insights for OTEL tracing and uat->staging rename #68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 5 commits
8eef6e1
901509d
3945195
8f6c24a
4f315b2
eb07474
9d5b99b
cab0205
ef8619a
c7d997a
4c5e506
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -33,23 +33,23 @@ env: | |
|
|
||
| jobs: | ||
| plan: | ||
| # PR into dev → dev | PR into main + label 'run-uat' → uat | Push to main/workflow_dispatch → prod | ||
| # PR into dev → dev | PR into main + label 'run-staging' → staging | Push to main/workflow_dispatch → prod | ||
| # Skip plan for PRs from forks (no repo secrets; avoids AADSTS700213) | ||
| # Runtime UAT toggle: add PR label 'run-uat' to enable UAT on PRs into main. | ||
| # Runtime UAT toggle: add PR label 'run-staging' to enable UAT on PRs into main. | ||
| if: | | ||
| (github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork == false) && | ||
| ( | ||
| (github.event_name == 'push' && github.ref == 'refs/heads/main') || | ||
| (github.event_name == 'workflow_dispatch') || | ||
| (github.event_name == 'pull_request' && github.event.pull_request.base.ref == 'dev') || | ||
| (github.event_name == 'pull_request' && github.event.pull_request.base.ref == 'main' && contains(join(github.event.pull_request.labels.*.name, ','), 'run-uat')) | ||
| (github.event_name == 'pull_request' && github.event.pull_request.base.ref == 'main' && contains(join(github.event.pull_request.labels.*.name, ','), 'run-staging')) | ||
| ) | ||
| name: Plan ${{ matrix.environment }} | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| environment: ${{ (github.event_name == 'workflow_dispatch' && fromJSON('["prod"]')) || (github.event_name == 'push' && github.ref == 'refs/heads/main' && fromJSON('["prod"]')) || (github.event_name == 'pull_request' && github.event.pull_request.base.ref == 'dev' && fromJSON('["dev"]')) || (github.event_name == 'pull_request' && github.event.pull_request.base.ref == 'main' && contains(join(github.event.pull_request.labels.*.name, ','), 'run-uat') && fromJSON('["uat"]')) || fromJSON('["prod"]') }} | ||
| environment: ${{ (github.event_name == 'workflow_dispatch' && fromJSON('["prod"]')) || (github.event_name == 'push' && github.ref == 'refs/heads/main' && fromJSON('["prod"]')) || (github.event_name == 'pull_request' && github.event.pull_request.base.ref == 'dev' && fromJSON('["dev"]')) || (github.event_name == 'pull_request' && github.event.pull_request.base.ref == 'main' && contains(join(github.event.pull_request.labels.*.name, ','), 'run-staging') && fromJSON('["staging"]')) || fromJSON('["prod"]') }} | ||
| environment: ${{ matrix.environment }} | ||
| defaults: | ||
| run: | ||
|
|
@@ -324,18 +324,18 @@ jobs: | |
|
|
||
| jq -e '.enabled == true' /tmp/selection-get.json > /dev/null | ||
|
|
||
|
Comment on lines
+154
to
+170
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🌐 Web query:
💡 Result: No. A job that calls a reusable workflow via Documented way to bind to
Example: Caller: jobs:
deploy:
strategy:
matrix:
target: [dev, staging, prod]
uses: org/repo/.github/workflows/deploy.yml@main
with:
target: ${{ matrix.target }}[2] Reusable workflow ( on:
workflow_call:
inputs:
target:
required: true
type: string
jobs:
deploy:
runs-on: ubuntu-latest
environment:
name: ${{ inputs.target }}
steps:
- run: echo "Deploying to ${{ inputs.target }}"[3] Sources: GitHub Docs on reusable-workflow keyword limits [1], reusable workflows + environment-secret note + matrix example [2], and workflow syntax for 🏁 Script executed: cd .github/workflows && head -n 220 deploy.yaml | tail -n 70Repository: phoenixvc/ai-gateway Length of output: 2993 Remove Jobs that call a reusable workflow via 🤖 Prompt for AI Agents |
||
| deploy-uat: | ||
| name: Deploy uat | ||
| deploy-staging: | ||
| name: Deploy staging | ||
| needs: plan | ||
| runs-on: ubuntu-latest | ||
| if: github.event_name == 'pull_request' && github.event.pull_request.base.ref == 'main' && contains(join(github.event.pull_request.labels.*.name, ','), 'run-uat') | ||
| environment: uat | ||
| if: github.event_name == 'pull_request' && github.event.pull_request.base.ref == 'main' && contains(join(github.event.pull_request.labels.*.name, ','), 'run-staging') | ||
| environment: staging | ||
| defaults: | ||
| run: | ||
| working-directory: infra/env/uat | ||
| working-directory: infra/env/staging | ||
|
|
||
| env: | ||
| TF_VAR_env: "uat" | ||
| TF_VAR_env: "staging" | ||
| TF_VAR_projname: "aigateway" | ||
| TF_VAR_location: "southafricanorth" | ||
| TF_VAR_location_short: "san" | ||
|
|
@@ -407,7 +407,7 @@ jobs: | |
| -backend-config="resource_group_name=${TF_BACKEND_RG}" \ | ||
| -backend-config="storage_account_name=${TF_BACKEND_SA}" \ | ||
| -backend-config="container_name=${TF_BACKEND_CONTAINER}" \ | ||
| -backend-config="key=uat.terraform.tfstate" | ||
| -backend-config="key=staging.terraform.tfstate" | ||
|
|
||
| - name: Import existing Container App into Terraform state | ||
| uses: ./.github/actions/import-container-app | ||
|
|
@@ -416,7 +416,7 @@ jobs: | |
| env: ${{ env.TF_VAR_env }} | ||
| location_short: ${{ env.TF_VAR_location_short }} | ||
| subscription_id: ${{ env.AZURE_SUBSCRIPTION_ID }} | ||
| terraform_working_directory: infra/env/uat | ||
| terraform_working_directory: infra/env/staging | ||
|
|
||
| - name: Terraform Plan | ||
| run: | | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.