-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (43 loc) · 1.76 KB
/
shared-deploy-withenvironment.yml
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
name: Shared workflow to deploy to an environment
on:
workflow_call:
inputs:
environment-name:
description: 'The environment to deploy to'
required: false
type: string
jobs:
build-and-deploy:
runs-on: ubuntu-latest
environment: ${{ inputs.environment-name }}
env:
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
AZURE_ENV_NAME: ${{ inputs.environment-name }}
AZURE_LOCATION: ${{ vars.AZURE_LOCATION }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install azd
uses: Azure/[email protected]
# this is the version for the release
# - name: Install .NET Aspire workload
# run: dotnet workload install aspire
# temporary version for daily build
- name: Update workloads
run: dotnet workload update --skip-sign-check --source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet8/nuget/v3/index.json
- name: Install .NET Aspire workload
run: dotnet workload install aspire --skip-sign-check --source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet8/nuget/v3/index.json
- name: Log in with Azure (Federated Credentials)
if: ${{ env.AZURE_CLIENT_ID != '' }}
run: |
azd auth login `
--client-id "$Env:AZURE_CLIENT_ID" `
--federated-credential-provider "github" `
--tenant-id "$Env:AZURE_TENANT_ID"
shell: pwsh
- name: Provision Infrastructure
run: azd provision --environment ${{ env.AZURE_ENV_NAME }} --no-prompt
- name: Deploy Application
run: azd deploy --environment ${{ env.AZURE_ENV_NAME }} --no-prompt