🛠️ Improving toast notifications #16
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
pull_request: | |
paths-ignore: | |
- "src/AnimeFeedManager.WebApp**" | |
- "src/AnimeFeedManager.Functions**" | |
- 'deployment/*' | |
- '!deployment/main-blazor.bicep' | |
- "**/*.md" | |
types: [opened, synchronize, reopened, closed] | |
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" | |
# 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@v1.6.1 | |
with: | |
creds: ${{ secrets.AZURE_CREDENTIALS }} | |
# Get variables from infrastructure | |
- name: Get variables from infrastructure | |
uses: Azure/arm-deploy@v1 | |
id: infrastructure | |
with: | |
scope: resourcegroup | |
subscriptionId: ${{ secrets.AZURE_SUBSCRIPTION }} | |
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 | |
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 | |