-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
20 additions
and
37 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: azd provision and deploy | ||
name: Deploy | ||
|
||
on: | ||
workflow_dispatch: | ||
|
@@ -21,25 +21,34 @@ jobs: | |
build: | ||
runs-on: ubuntu-latest | ||
env: | ||
# azd required | ||
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 }} | ||
AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} | ||
AZURE_PRINCIPAL_TYPE: 'ServicePrincipal' | ||
|
||
# project specific | ||
AZURE_OPENAI_ENDPOINT: ${{ vars.AZURE_OPENAI_ENDPOINT }} | ||
AZURE_OPENAI_API_VERSION: ${{ vars.AZURE_OPENAI_API_VERSION }} | ||
AZURE_OPENAI_4_EVAL_DEPLOYMENT_NAME: ${{ vars.AZURE_OPENAI_4_EVAL_DEPLOYMENT_NAME }} | ||
AZURE_OPENAI_DEPLOYMENT_NAME: ${{ vars.AZURE_OPENAI_DEPLOYMENT_NAME }} | ||
AZURE_OPENAI_35_TURBO_DEPLOYMENT_NAME: ${{ vars.AZURE_OPENAI_35_TURBO_DEPLOYMENT_NAME }} | ||
AZURE_SEARCH_ENDPOINT: ${{ vars.AZURE_SEARCH_ENDPOINT }} | ||
AZURE_SEARCH_INDEX_NAME: ${{ vars.AZURE_SEARCH_INDEX_NAME }} | ||
BING_SEARCH_ENDPOINT: ${{ vars.BING_SEARCH_ENDPOINT }} | ||
BING_SEARCH_KEY: ${{ secrets.BING_SEARCH_KEY }} | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install azd | ||
uses: Azure/[email protected] | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@v5 | ||
- name: Install Nodejs | ||
uses: actions/setup-node@v4 | ||
with: | ||
python-version: '3.11' | ||
node-version: 18 | ||
|
||
- name: Log in with Azure (Federated Credentials) | ||
if: ${{ env.AZURE_CLIENT_ID != '' }} | ||
|
@@ -64,38 +73,12 @@ jobs: | |
env: | ||
AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} | ||
|
||
- name: Azure login | ||
uses: azure/login@v2 | ||
with: | ||
client-id: ${{ env.AZURE_CLIENT_ID }} | ||
tenant-id: ${{ env.AZURE_TENANT_ID }} | ||
subscription-id: ${{ env.AZURE_SUBSCRIPTION_ID }} | ||
|
||
- name: Set az account | ||
uses: azure/CLI@v2 | ||
with: | ||
inlineScript: | | ||
az account set --subscription ${{env.AZURE_SUBSCRIPTION_ID}} | ||
- name: Provision Infrastructure | ||
run: azd provision --no-prompt | ||
env: | ||
AZURE_ENV_NAME: ${{ vars.AZURE_ENV_NAME }} | ||
AZURE_LOCATION: ${{ vars.AZURE_LOCATION }} | ||
AZURE_SUBSCRIPTION_ID: ${{ vars.AZURE_SUBSCRIPTION_ID }} | ||
AZD_INITIAL_ENVIRONMENT_CONFIG: ${{ secrets.AZD_INITIAL_ENVIRONMENT_CONFIG }} | ||
AZURE_SERVER_APP_SECRET: ${{ secrets.AZURE_SERVER_APP_SECRET }} | ||
AZURE_CLIENT_APP_SECRET: ${{ secrets.AZURE_CLIENT_APP_SECRET }} | ||
|
||
- name: Deploy Application | ||
run: azd deploy --no-prompt | ||
env: | ||
AZURE_ENV_NAME: ${{ vars.AZURE_ENV_NAME }} | ||
AZURE_LOCATION: ${{ vars.AZURE_LOCATION }} | ||
AZURE_SUBSCRIPTION_ID: ${{ vars.AZURE_SUBSCRIPTION_ID }} | ||
|
||
build_test_all: | ||
if: always() | ||
runs-on: ubuntu-latest | ||
needs: build | ||
steps: | ||
- name: Check build matrix status | ||
if: ${{ needs.build.result != 'success' }} | ||
run: exit 1 | ||
run: azd deploy --no-prompt |