Skip to content

chore(blazor): migrate to blazor bc dotnet is bestnet #1

chore(blazor): migrate to blazor bc dotnet is bestnet

chore(blazor): migrate to blazor bc dotnet is bestnet #1

Workflow file for this run

name: Azure Web App CI/CD
on:
push:
branches: ['main']
pull_request:
types: [opened, synchronize, reopened]
branches: ['main']
workflow_dispatch:
permissions:
contents: read
pull-requests: write
env:
DOTNET_VERSION: '8.x'
APP_PROJECT_FILE: './src/App/VictorFrye.Graveyard.csproj'
APP_OUTPUT_LOCATION: './publish'
APP_ARTIFACT_NAME: 'app-${{ github.sha }}'
jobs:
build:
name: Build
runs-on: ubuntu-latest
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
lfs: false
- name: Set Up .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Restore Dependencies
run: dotnet restore
- name: Verify Formatting
run: dotnet format --verify-no-changes --no-restore
- name: Build Solution
run: dotnet build -c Release --no-restore
- name: Run Tests
run: dotnet test -c Release --no-restore
- name: Publish App
if: github.event_name == 'push'
run: dotnet publish ${{ env.APP_PROJECT_FILE }} -c Release -o ${{ env.APP_OUTPUT_LOCATION }} --no-restore --no-build
- name: Upload artifact
if: github.event_name == 'push'
uses: actions/upload-artifact@v3
with:
name: ${{ env.APP_ARTIFACT_NAME }}
path: ${{ env.APP_OUTPUT_LOCATION }}
deploy:
name: Deploy
if: github.event_name == 'push'
runs-on: ubuntu-latest
needs: build
environment:
name: ${{ github.event_name == 'push' && 'Production' || 'Staging' }}
url: ${{ steps.deploy-to-webapp.outputs.webapp-url }}
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
permissions:
id-token: write #This is required for requesting the JWT
steps:
- name: Download artifact
uses: actions/download-artifact@v3
with:
name: ${{ env.APP_ARTIFACT_NAME }}
# - name: Login to Azure
# uses: azure/login@v1
# with:
# client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_1E91DC00E9D14E53A32EF16A2525A8B7 }}
# tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_8335C2ED4DB043D09F772DA0C4190304 }}
# subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_E53ED1421FF14D8791C4BA82439F1941 }}
- name: Deploy Azure Web App
id: deploy-to-webapp
uses: azure/webapps-deploy@v2
with:
app-name: 'app-graveyard'
slot-name: 'Production'
package: .