Skip to content

Deploy to Azure Static Web Apps #18

Deploy to Azure Static Web Apps

Deploy to Azure Static Web Apps #18

name: Deploy to Azure Static Web Apps
on: workflow_dispatch
jobs:
#====== Build and deploy ======#
build_and_deploy_job:
runs-on: ubuntu-latest
name: Build and Deploy
steps:
# Checkout repository
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: true
# Setup .NET
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
# Restore dependencies
- name: Restore dependencies
run: dotnet restore
# Build app
- name: Build
run: dotnet build --configuration Release --no-restore
# Publish app
- name: Publish
run: dotnet publish --configuration Release --no-build --output ./wwwroot
# Deploy to Azure Static Web Apps
- name: Deploy
id: builddeploy
uses: Azure/static-web-apps-deploy@v1
with:
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_DEPLOY_TOKEN }}
repo_token: ${{ secrets.GITHUB_TOKEN }}
action: 'upload'
app_location: '/src/AspNet.Core.Blazor.WebAssembly'
output_location: 'wwwroot'