From 4481941546fd8856b927c8a682157136d8bc0027 Mon Sep 17 00:00:00 2001 From: Collin Barrett Date: Mon, 27 May 2024 16:30:04 -0500 Subject: [PATCH] Configure Azure Developer Pipeline --- .github/workflows/azure-dev.yml | 48 +++++++++++++++++++++++++ services/FilterLists.AppHost/.gitignore | 1 + services/FilterLists.AppHost/azure.yaml | 8 +++++ 3 files changed, 57 insertions(+) create mode 100644 .github/workflows/azure-dev.yml create mode 100644 services/FilterLists.AppHost/.gitignore create mode 100644 services/FilterLists.AppHost/azure.yaml diff --git a/.github/workflows/azure-dev.yml b/.github/workflows/azure-dev.yml new file mode 100644 index 000000000..59ea8f174 --- /dev/null +++ b/.github/workflows/azure-dev.yml @@ -0,0 +1,48 @@ +name: Build and Deploy Services + +on: + workflow_dispatch: + push: + branches: + - aspire + +permissions: + id-token: write + contents: read + +jobs: + build: + runs-on: ubuntu-latest + 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 }} + AZURE_DEV_COLLECT_TELEMETRY: "no" + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install azd + uses: Azure/setup-azd@v1.0.0 + + - name: Install .NET Aspire workload + run: dotnet workload install aspire + + - 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 --no-prompt -C services/FilterLists.AppHost + env: + AZD_INITIAL_ENVIRONMENT_CONFIG: ${{ secrets.AZD_INITIAL_ENVIRONMENT_CONFIG }} + + - name: Deploy Application + run: azd deploy --no-prompt -C services/FilterLists.AppHost diff --git a/services/FilterLists.AppHost/.gitignore b/services/FilterLists.AppHost/.gitignore new file mode 100644 index 000000000..8e8438024 --- /dev/null +++ b/services/FilterLists.AppHost/.gitignore @@ -0,0 +1 @@ +.azure diff --git a/services/FilterLists.AppHost/azure.yaml b/services/FilterLists.AppHost/azure.yaml new file mode 100644 index 000000000..a1f03c786 --- /dev/null +++ b/services/FilterLists.AppHost/azure.yaml @@ -0,0 +1,8 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/Azure/azure-dev/main/schemas/v1.0/azure.yaml.json + +name: FilterLists.AppHost +services: + app: + language: dotnet + project: ./FilterLists.AppHost.csproj + host: containerapp