Skip to content

Commit 8540f04

Browse files
committed
Update GitHub Actions workflow for Azure SWA deployment
- Added a `name` property to the `build_and_deploy_job` for clarity. - Updated `actions/checkout` to `v4` for latest improvements. - Replaced old deployment step with .NET 10 SDK setup and a new `azure/static-web-apps-deploy` step for Blazor WASM apps. - Changed `app_location` to `wwwroot` and commented out the optional `output_location` configuration. - Enhanced readability, maintainability, and compatibility with modern tools and practices.
1 parent f33bd65 commit 8540f04

File tree

1 file changed

+17
-6
lines changed

1 file changed

+17
-6
lines changed

.github/workflows/azure-static-web-apps-calm-plant-04da70210.yml

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,25 +13,36 @@ jobs:
1313
build_and_deploy_job:
1414
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed')
1515
runs-on: ubuntu-latest
16+
1617
name: Build and Deploy Job
1718
steps:
18-
- uses: actions/checkout@v3
19+
- uses: actions/checkout@v4
1920
with:
2021
submodules: true
2122
lfs: false
22-
- name: Build And Deploy
23-
id: builddeploy
24-
uses: Azure/static-web-apps-deploy@v1
23+
24+
# 1. Setup .NET 10 SDK
25+
- name: Setup .NET
26+
uses: actions/setup-dotnet@v4
27+
with:
28+
dotnet-version: '10.0.x' # Specifies the use of .NET 10 SDK
29+
30+
# 2. Azure Static Web App Deployment Action
31+
# This action automatically handles the dotnet restore, build, and publish steps
32+
# and deploys the output to SWA.
33+
- name: Build And Deploy Blazor WASM App
34+
id: swa
35+
uses: azure/static-web-apps-deploy@v1
2536
with:
2637
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_CALM_PLANT_04DA70210 }}
2738
repo_token: ${{ secrets.GITHUB_TOKEN }} # Used for Github integrations (i.e. PR comments)
2839
action: "upload"
2940
###### Repository/Build Configurations - These values can be configured to match your app requirements. ######
3041
# For more information regarding Static Web App workflow configurations, please visit: https://aka.ms/swaworkflowconfig
3142
#app_location: "Client" # App source code path
32-
app_location: "/" # App source code path
43+
app_location: "wwwroot" # App source code path
3344
#api_location: "Api" # Api source code path - optional
34-
output_location: "wwwroot" # Built app content directory - optional
45+
#output_location: "wwwroot" # Built app content directory - optional
3546
###### End of Repository/Build Configurations ######
3647

3748
close_pull_request_job:

0 commit comments

Comments
 (0)