Skip to content

🩹 Fixing issues with worker crashing #76

🩹 Fixing issues with worker crashing

🩹 Fixing issues with worker crashing #76

name: AFM Blazor SSR Deployment
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the 'main' branch
push:
paths-ignore:
- "src/AnimeFeedManager.WebApp**"
- "src/AnimeFeedManager.Functions**"
- "deployment/*"
- "!deployment/main-blazor.bicep"
- "**/*.md"
branches:
- main
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
env:
DOTNET_VERSION: "8.0.x" # set this to the dotnet version to use
APP_PATH: "./src/AnimeFeedManager.Web"
TEST_PROJECT_PATH: "./src/AnimeFeedManager.Features.Tests"
# login with OIDC permissions
permissions:
id-token: write
contents: read
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
build-and-deploy-blazor-ssr-app:
runs-on: ubuntu-latest
steps:
# Checkout the repo
- uses: actions/checkout@main
- uses: azure/login@v2.1.1
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
# Get variables from infrastructure
- name: Get variables from infrastructure
uses: Azure/arm-deploy@v2
id: infrastructure
with:
scope: resourcegroup
subscriptionId: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
resourceGroupName: ${{ secrets.AZURE_RG }}
template: ./deployment/main-blazor.bicep
failOnStdErr: false
# Setup node.js for tailwind
- name: Setup Node lts
uses: actions/setup-node@v4.0.2
with:
node-version: lts/*
- name: "npm install, build, and test"
run: |
npm install
npx tailwindcss -i ./Styles/app.css -o ./wwwroot/app.css --minify
working-directory: ${{ env.APP_PATH }}
# Setup .NET Core SDK
- name: Setup DotNet ${{ env.DOTNET_VERSION }} Environment
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
# Run Test
- name: Test Using Dotnet
shell: bash
run: dotnet test '${{ env.TEST_PROJECT_PATH }}'
# Run dotnet build and publish
- name: dotnet build and publish
shell: bash
run: |
pushd '${{ env.APP_PATH }}'
dotnet restore
dotnet build --configuration Release
dotnet publish -c Release --output ./output
popd
# Deploy to Azure Web apps
- name: "Run Azure webapp deploy action using publish profile credentials"
uses: azure/webapps-deploy@v3
with:
app-name: ${{ steps.infrastructure.outputs.appname }}
package: "${{ env.APP_PATH }}/output"
- name: logout
run: |
az logout