Skip to content

Commit

Permalink
Disabling most of the steps in the Azure actions to test the authenti…
Browse files Browse the repository at this point in the history
…cation with the remainder that don't change resources
  • Loading branch information
BenedekFarkas committed Sep 18, 2023
1 parent 9ded176 commit 3b7d344
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 7 deletions.
11 changes: 9 additions & 2 deletions .github/workflows/deploy-orchard1-to-azure-app-service.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,19 +105,23 @@ jobs:
timeout-minutes: ${{ inputs.timeout-minutes }}
steps:
- name: Checkout
if: false
uses: Lombiq/GitHub-Actions/.github/actions/checkout@dev
with:
token: ${{ secrets.CHECKOUT_TOKEN }}

- name: Enable Node corepack
if: false
uses: Lombiq/GitHub-Actions/.github/actions/enable-corepack@dev

# Calling nuget restore separately on the actual solution, because we're passing Orchard.proj to the msbuild
# action instead to be able to call the Precompiled target.
- name: Restore NuGet packages
if: false
run: nuget restore ${{ inputs.build-directory }}\${{ inputs.solution-or-project-path }}

- name: Publish Precompiled App
if: false
uses: Lombiq/GitHub-Actions/.github/actions/msbuild@dev
with:
solution-or-project-path: Orchard.proj
Expand Down Expand Up @@ -151,6 +155,7 @@ jobs:
run: Start-Sleep -Seconds 30

- name: Deploy to Azure App Service
if: false
uses: azure/webapps-deploy@016bdd3f9b7cec60310bcf9da98f671628795644 # v2.2.4
with:
app-name: ${{ inputs.app-name }}
Expand All @@ -159,7 +164,8 @@ jobs:
package: build\Precompiled

- name: Add Azure Application Insights Release Annotation
if: ${{ inputs.application-insights-resource-id != '' }}
if: false
# if: ${{ inputs.application-insights-resource-id != '' }}
uses: Lombiq/GitHub-Actions/.github/actions/add-azure-application-insights-release-annotation@dev
with:
release-name: "Deploy #${{ github.run_number }} to ${{ inputs.slot-name }}"
Expand All @@ -180,7 +186,8 @@ jobs:
-SlotName ${{ inputs.slot-name }}
- name: Start AfterDeploy Maintenance on the Destination Slot
if: inputs.maintenance-host-name != ''
if: false
# if: inputs.maintenance-host-name != ''
run: |
$maintenanceParameters = @{
HostName = '${{ inputs.maintenance-host-name }}'
Expand Down
10 changes: 9 additions & 1 deletion .github/workflows/deploy-to-azure-app-service.yml
Original file line number Diff line number Diff line change
Expand Up @@ -128,28 +128,33 @@ jobs:
timeout-minutes: ${{ inputs.timeout-minutes }}
steps:
- name: Checkout
if: false
uses: Lombiq/GitHub-Actions/.github/actions/checkout@dev
with:
token: ${{ secrets.CHECKOUT_TOKEN }}

- name: Set up .NET
if: false
uses: Lombiq/GitHub-Actions/.github/actions/setup-dotnet@dev
with:
dotnet-version: ${{ inputs.dotnet-version }}

- name: Enable Node corepack
if: false
uses: Lombiq/GitHub-Actions/.github/actions/enable-corepack@dev

# If runtime is defined, we need to add "--runtime=" to the string so it will be a valid build/publish option. The
# "build-dotnet" action requires the additional switches to be in separate lines (even the parameters), but we can
# take advantage of the dotnet CLI tolerating the usage of the equal sign.
- name: Set up runtime option
if: false
id: set-up-runtime-option
if: ${{ inputs.runtime != '' }}
# if: ${{ inputs.runtime != '' }}
run: |
"runtime-option=--runtime=${{ inputs.runtime }}" >> $Env:GITHUB_OUTPUT
- name: Build and Static Code Analysis
if: false
uses: Lombiq/GitHub-Actions/.github/actions/build-dotnet@dev
with:
directory: ${{ inputs.build-directory }}
Expand All @@ -168,6 +173,7 @@ jobs:
-p:BuildVersionDisplay_BuildUrl=https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
- name: Publish
if: false
run: |
dotnet publish (Get-ChildItem ${{ inputs.web-project-path }}).FullName `
--no-build `
Expand Down Expand Up @@ -196,6 +202,7 @@ jobs:
-SlotName ${{ inputs.slot-name }}
- name: Deploy to Azure App Service
if: false
uses: azure/webapps-deploy@016bdd3f9b7cec60310bcf9da98f671628795644 # v2.2.4
with:
app-name: ${{ inputs.app-name }}
Expand All @@ -204,6 +211,7 @@ jobs:
package: ${{ inputs.build-directory }}/Published

- name: Add Azure Application Insights Release Annotation
if: false
uses: Lombiq/GitHub-Actions/.github/actions/add-azure-application-insights-release-annotation@dev
with:
release-name: "Deploy #${{ github.run_number }} to ${{ inputs.slot-name }}"
Expand Down
11 changes: 9 additions & 2 deletions .github/workflows/reset-azure-environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ jobs:
-SlotName ${{ inputs.destination-slot-name }}
- name: Replace Media
if: false
run: |
Set-AzureWebAppStorageContentFromStorage `
-ResourceGroupName ${{ inputs.resource-group-name }} `
Expand All @@ -165,6 +166,7 @@ jobs:
-FolderWhiteList ${{ inputs.folder-include-list }}
- name: Replace Database
if: false
run: |
Copy-AzureWebAppSqlDatabase `
-ResourceGroupName ${{ inputs.resource-group-name }} `
Expand All @@ -175,6 +177,7 @@ jobs:
-Force
- name: Add Destination Contained User to Destination Database
if: false
run: |
Install-Module sqlserver -AllowClobber -Force
Add-AzureWebAppSqlDatabaseContainedUser `
Expand All @@ -185,6 +188,7 @@ jobs:
-UserConnectionStringName ${{ inputs.database-connection-string-name }}
- name: Remove Source Contained User from Destination Database
if: false
run: |
Remove-AzureWebAppSqlDatabaseContainedUser `
-ResourceGroupName ${{ inputs.resource-group-name }} `
Expand All @@ -195,7 +199,8 @@ jobs:
-UserConnectionStringName ${{ inputs.database-connection-string-name }}
- name: Add Azure Application Insights Release Annotation
if: ${{ inputs.application-insights-resource-id != '' }}
if: false
# if: ${{ inputs.application-insights-resource-id != '' }}
uses: Lombiq/GitHub-Actions/.github/actions/add-azure-application-insights-release-annotation@dev
with:
release-name: "Reset #${{ github.run_number }} from ${{ inputs.source-slot-name }} to ${{ inputs.destination-slot-name }}"
Expand All @@ -216,7 +221,8 @@ jobs:
-SlotName ${{ inputs.destination-slot-name }}
- name: Start AfterReplace Maintenance on the Destination Slot
if: inputs.maintenance-host-name != ''
if: false
# if: inputs.maintenance-host-name != ''
run: |
$maintenanceParameters = @{
HostName = '${{ inputs.maintenance-host-name }}'
Expand All @@ -228,6 +234,7 @@ jobs:
Start-Maintenance @maintenanceParameters
- name: Scale Database
if: false
run: |
Set-AzureWebAppSqlDatabaseServiceObjective `
-ResourceGroupName ${{ inputs.resource-group-name }} `
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/swap-azure-web-app-slots.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ jobs:
-SlotName ${{ inputs.source-slot-name }}
- name: Swap Web App Slots
if: false
run: |
Switch-AzWebAppSlot `
-ResourceGroupName ${{ inputs.resource-group-name }} `
Expand All @@ -92,6 +93,7 @@ jobs:
-DestinationSlotName ${{ inputs.destination-slot-name }}
- name: Add Azure Application Insights Release Annotation
if: false
uses: Lombiq/GitHub-Actions/.github/actions/add-azure-application-insights-release-annotation@dev
with:
release-name: "Swap #${{ github.run_number }} from ${{ inputs.source-slot-name }} to ${{ inputs.destination-slot-name }}"
Expand Down
21 changes: 19 additions & 2 deletions .github/workflows/swap-orchard1-azure-web-app-slots.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,15 @@ jobs:
- name: Initialize PowerShell modules
uses: Lombiq/Infrastructure-Scripts/.github/actions/initialize@dev

- name: Test Source Web App Slot
run: |
Test-AzureWebApp `
-ResourceGroupName ${{ inputs.resource-group-name }} `
-WebAppName ${{ inputs.app-name }} `
-SlotName ${{ inputs.source-slot-name }}
- name: Swap Web App Slots
if: false
run: |
Switch-AzureWebAppSlots `
-ResourceGroupName ${{ inputs.resource-group-name }} `
Expand All @@ -95,14 +103,23 @@ jobs:
-DestinationSlotName ${{ inputs.destination-slot-name }}
- name: Add Azure Application Insights Release Annotation
if: ${{ inputs.application-insights-resource-id != '' }}
if: false
# if: ${{ inputs.application-insights-resource-id != '' }}
uses: Lombiq/GitHub-Actions/.github/actions/add-azure-application-insights-release-annotation@dev
with:
release-name: "Swap #${{ github.run_number }} from ${{ inputs.source-slot-name }} to ${{ inputs.destination-slot-name }}"
application-insights-resource-id: ${{ inputs.application-insights-resource-id }}

- name: Test Destination Web App Slot
run: |
Test-AzureWebApp `
-ResourceGroupName ${{ inputs.resource-group-name }} `
-WebAppName ${{ inputs.app-name }} `
-SlotName ${{ inputs.destination-slot-name }}
- name: Start AfterSwap Maintenance on the Destination Slot
if: inputs.maintenance-host-name != ''
if: false
# if: inputs.maintenance-host-name != ''
run: |
$maintenanceParameters = @{
HostName = '${{ inputs.maintenance-host-name }}'
Expand Down

0 comments on commit 3b7d344

Please sign in to comment.