Fix image push #522
Workflow file for this run
This file contains 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: Bicep What If | |
env: | |
REGION: westus3 | |
REGIONAL_RESOURCEGROUP: aro-hcp-dev-westus3 | |
SC_RESOURCEGROUP: aro-hcp-dev-westus3-sc | |
MC_RESOURCEGROUP: aro-hcp-dev-westus3-mc-1 | |
IMAGE_SYNC_RESOURCEGROUP: aro-hcp-dev-image-sync | |
GLOBAL_RESOURCEGROUP: global | |
ARO_HCP_IMAGE_ACR: arohcpdev | |
on: | |
pull_request: | |
branches: | |
- main | |
paths: | |
- 'dev-infrastructure/**/*.bicep' | |
- 'dev-infrastructure/**/*.bicepparam' | |
- '.github/workflows/bicep-what-if.yml' | |
- '.github/workflows/aro-hcp-dev-env-cd.yml' | |
jobs: | |
what-if: | |
permissions: | |
id-token: 'write' | |
contents: 'read' | |
runs-on: 'ubuntu-latest' | |
steps: | |
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 | |
with: | |
fetch-depth: 1 | |
- name: 'Az CLI login' | |
uses: azure/login@6c251865b4e6290e7b78be643ea2d005bc51f69a # v2.1.1 | |
with: | |
client-id: ${{ secrets.AZURE_CLIENT_ID }} | |
tenant-id: ${{ secrets.AZURE_TENANT_ID }} | |
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} | |
# TODO: We don't have `make` in the azure/cli task so a lot of this is duplicated in dev-infrastructure/Makefile | |
# we should run our own container or find a solution to bring them closer | |
- name: 'Deployment What If' | |
uses: azure/cli@089eac9d8cc39f5d003e94f8b65efc51076c9cbd # v2.1.0 | |
with: | |
azcliversion: 2.63.0 | |
inlineScript: | | |
cd dev-infrastructure/ | |
az group create -g "${SC_RESOURCEGROUP}" -l "${REGION}" --tags persist=true | |
az group create -g "${MC_RESOURCEGROUP}" -l "${REGION}" --tags persist=true | |
az group create -g "${REGIONAL_RESOURCEGROUP}" -l "${REGION}" --tags persist=true | |
az group create -g "${IMAGE_SYNC_RESOURCEGROUP}" -l "${REGION}" --tags persist=true | |
# Image Sync | |
az deployment group what-if \ | |
--name "image-sync" \ | |
--resource-group ${IMAGE_SYNC_RESOURCEGROUP} \ | |
--template-file templates/image-sync.bicep \ | |
--parameters \ | |
configurations/mvp-image-sync.bicepparam | |
# ACR | |
az deployment group what-if \ | |
--name "dev-acr-${GITHUB_RUN_ID}" \ | |
--resource-group "${GLOBAL_RESOURCEGROUP}" \ | |
--template-file templates/dev-acr.bicep \ | |
--parameters configurations/mvp-dev-acr.bicepparam | |
# OCP ACR | |
az deployment group what-if \ | |
--name "dev-ocp-acr-${GITHUB_RUN_ID}" \ | |
--resource-group ${GLOBAL_RESOURCEGROUP} \ | |
--template-file templates/dev-acr.bicep \ | |
--parameters configurations/mvp-dev-ocp-acr.bicepparam | |
# SVC ACR | |
az deployment group what-if \ | |
--name "dev-svc-acr-${GITHUB_RUN_ID}" \ | |
--resource-group ${GLOBAL_RESOURCEGROUP} \ | |
--template-file templates/dev-acr.bicep \ | |
--parameters configurations/mvp-dev-svc-acr.bicepparam | |
# region infra | |
az deployment group what-if \ | |
--name "region-${GITHUB_RUN_ID}" \ | |
--resource-group "${REGIONAL_RESOURCEGROUP}" \ | |
--template-file templates/region.bicep \ | |
--parameters configurations/mvp-region.bicepparam \ | |
--parameters regionalDNSSubdomain="${REGION}" | |
# service cluster | |
az deployment group what-if \ | |
--name "svc-cluster-${GITHUB_RUN_ID}" \ | |
--resource-group "${SC_RESOURCEGROUP}" \ | |
--template-file templates/svc-cluster.bicep \ | |
--parameters configurations/mvp-svc-cluster.bicepparam \ | |
--parameters currentUserId="${GITHUB_ACTOR}" \ | |
--parameters regionalResourceGroup="${REGIONAL_RESOURCEGROUP}" | |
# management cluster | |
az deployment group what-if \ | |
--name "mgmt-cluster-${GITHUB_RUN_ID}" \ | |
--resource-group "${MC_RESOURCEGROUP}" \ | |
--template-file templates/mgmt-cluster.bicep \ | |
--parameters configurations/mvp-mgmt-cluster.bicepparam \ | |
--parameters currentUserId="${GITHUB_ACTOR}" \ | |
--parameters regionalResourceGroup="${REGIONAL_RESOURCEGROUP}" | |
# metrics infrastructure | |
az deployment group what-if \ | |
--name "metrics-infra-${GITHUB_RUN_ID}" \ | |
--resource-group "${REGIONAL_RESOURCEGROUP}" \ | |
--template-file modules/metrics/metrics.bicep \ | |
--parameters configurations/mvp-metrics.bicepparam \ | |
--parameters globalResourceGroup="${REGIONAL_RESOURCEGROUP}" |