Skip to content

Commit 9307c6d

Browse files
authored
Add a azd CI pipeline (Azure-Samples#337)
* Add azd ci * Name the workflow * Debug * Remove federated login * Change string interpolation * Set the azure subscription * Add azd into current ci * azd from devcontainer * Pass env into container * Break command up * Simpllyfy in make
1 parent 7b8252c commit 9307c6d

File tree

4 files changed

+24
-60
lines changed

4 files changed

+24
-60
lines changed

.github/workflows/AdminWebApp.yml

-29
This file was deleted.

.github/workflows/CwyodBackend.yml

-30
This file was deleted.

.github/workflows/ci.yml

+17-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
name: CI
22

33
on:
4+
workflow_dispatch:
45
pull_request:
56
push:
67
branches:
@@ -13,6 +14,11 @@ permissions:
1314
jobs:
1415
build:
1516
runs-on: ubuntu-latest
17+
env:
18+
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
19+
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
20+
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
21+
AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }}
1622

1723
steps:
1824
- name: Checkout code
@@ -27,8 +33,18 @@ jobs:
2733

2834
- name: Pre-build image and run make in dev container
2935
uses: devcontainers/[email protected]
36+
env:
37+
AZURE_ENV_NAME: ${{ vars.AZURE_ENV_NAME }}
38+
AZURE_LOCATION: ${{ vars.AZURE_LOCATION }}
3039
with:
3140
imageName: ghcr.io/azure-samples/chat-with-your-data-solution-accelerator
3241
cacheFrom: ghcr.io/azure-samples/chat-with-your-data-solution-accelerator
33-
runCmd: make ci
42+
runCmd: make ci && make deploy
3443
refFilterForPush: refs/heads/main
44+
env: |
45+
AZURE_CLIENT_ID
46+
AZURE_CLIENT_SECRET
47+
AZURE_TENANT_ID
48+
AZURE_SUBSCRIPTION_ID
49+
AZURE_ENV_NAME
50+
AZURE_LOCATION

Makefile

+7
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,10 @@ build-frontend: ## 🏗️ Build the Frontend webapp
3333
azd-login: ## 🔑 Login to Azure with azd and a SPN
3434
@echo -e "\e[34m$@\e[0m" || true
3535
@azd auth login --client-id ${AZURE_CLIENT_ID} --client-secret ${AZURE_CLIENT_SECRET} --tenant-id ${AZURE_TENANT_ID}
36+
37+
deploy: azd-login ## 🚀 Deploy everything to Azure
38+
@echo -e "\e[34m$@\e[0m" || true
39+
@azd provision --no-prompt
40+
@azd deploy web --no-prompt
41+
@azd deploy function --no-prompt
42+
@azd deploy adminweb --no-prompt

0 commit comments

Comments
 (0)