-
Notifications
You must be signed in to change notification settings - Fork 42
56 lines (50 loc) · 2 KB
/
deploy.yml
File metadata and controls
56 lines (50 loc) · 2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
on:
workflow_dispatch:
# Uncomment the below line to run the workflow on commit
# push:
# # Run when commits are pushed to mainline branch
# # Set this to the mainline branch you are using
# branches:
# - main
# Set this permission if you are using a Federated Credential.
permissions:
id-token: write
contents: read
jobs:
build:
runs-on: ubuntu-latest
# azd build-in variables.
# This variables are always set by `azd pipeline config`
# You can set them as global env (apply to all steps) or you can add them to individual steps' environment
env:
AZURE_CLIENT_ID: ${{ vars.AZURE_CLIENT_ID }}
AZURE_TENANT_ID: ${{ vars.AZURE_TENANT_ID }}
AZURE_SUBSCRIPTION_ID: ${{ vars.AZURE_SUBSCRIPTION_ID }}
AZURE_ENV_NAME: ${{ vars.AZURE_ENV_NAME }}
AZURE_LOCATION: ${{ vars.AZURE_LOCATION }}
openAIName: ${{ secrets.openAIName }}
openAIRGName: ${{ secrets.openAIRGName }}
## Define the additional variables or secrets that are required globally (provision and deploy)
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Azure login
uses: azure/login@v2
with:
client-id: ${{ vars.AZURE_CLIENT_ID }}
tenant-id: ${{ vars.AZURE_TENANT_ID }}
subscription-id: ${{ vars.AZURE_SUBSCRIPTION_ID }}
- name: Azure CLI script
uses: azure/cli@v2
with:
azcliversion: latest
inlineScript: |
#!/bin/bash
rgExists=$(az group exists -n "rg-$AZURE_ENV_NAME")
if [ "$rgExists" = "false" ]; then
az group create --name "rg-$AZURE_ENV_NAME" --location "$AZURE_LOCATION"
fi
az deployment group create \
--resource-group "rg-$AZURE_ENV_NAME" \
--template-file deployment/infra-as-code-public/bicep/main-1click.bicep \
--parameters aiSearchRegion="$AZURE_LOCATION" openAIName="$openAIName" openAIRGName="$openAIRGName"