Skip to content

Commit 337ece4

Browse files
author
Raffaele Marcello
committed
Refactor Azure Bicep deployment workflow to include environment selection and update container registry SKU
1 parent 2c00aa1 commit 337ece4

File tree

2 files changed

+69
-0
lines changed

2 files changed

+69
-0
lines changed

.github/workflows/dotnet-deploy.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: .NET CI
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
paths: src/Application/**
7+
pull_request:
8+
branches: [ main ]
9+
paths: src/Application/**
10+
# Allows you to run this workflow manually from the Actions tab
11+
workflow_dispatch:
12+
jobs:
13+
build:
14+
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- uses: actions/checkout@v3
19+
- name: Setup .NET
20+
uses: actions/setup-dotnet@v3
21+
22+
- name: Restore dependencies
23+
run: dotnet restore ./src/Application/src/RazorPagesTestSample/RazorPagesTestSample.csproj
24+
- name: Build
25+
run: dotnet build --no-restore ./src/Application/src/RazorPagesTestSample/RazorPagesTestSample.csproj
26+
- name: Test
27+
run: dotnet test --no-build --verbosity normal ./src/Application/tests/RazorPagesTestSample.Tests/RazorPagesTestSample.Tests.csproj

.github/workflows/undeploy.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Destroy Azure Resource Group
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
appenv:
7+
type: choice
8+
description: Choose the target environment
9+
options:
10+
- dev
11+
- test
12+
- prod
13+
14+
jobs:
15+
destroy:
16+
runs-on: ubuntu-latest
17+
permissions:
18+
contents: read
19+
id-token: write
20+
steps:
21+
# Checkout code
22+
- uses: actions/checkout@main
23+
24+
# Log into Azure
25+
- uses: azure/[email protected]
26+
with:
27+
client-id: ${{ secrets.AZURE_CLIENT_ID }}
28+
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
29+
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
30+
enable-AzPSSession: true
31+
32+
# Destroy Resource Group
33+
- name: Destroy Resource Group
34+
run: |
35+
az group delete --name ${{ secrets.AZURE_RG }} --yes --no-wait
36+
37+
# - name: Azure ARM Deployment
38+
# uses: azure/ARM@v1
39+
# with:
40+
# azcliversion: 2.0.72
41+
# inlineScript: |
42+
# az group delete --name ${{ secrets.AZURE_RG }} --yes --no-wait

0 commit comments

Comments
 (0)