Skip to content

250

250 #8

Workflow file for this run

name: .NET CI/CD
on:
push:
branches: [ main ]
paths:
- src/Application/**
pull_request:
branches: [ main ]
paths:
- src/Application/**
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: '8.0.x'
- name: Restore dependencies
run: dotnet restore src/Application/src/RazorPagesTestSample/RazorPagesTestSample.csproj
- name: Build
run: dotnet build --no-restore src/Application/src/RazorPagesTestSample/RazorPagesTestSample.csproj
- name: Test
run: dotnet test --no-build --verbosity normal src/Application/tests/RazorPagesTestSample.Tests/RazorPagesTestSample.Tests.csproj
deploy-to-test:
runs-on: ubuntu-latest
needs: build
environment:
name: test
url: https://mpplabajep-test.azurewebsites.net/
steps:
- uses: actions/checkout@v3
- name: 'Login via Azure CLI'
uses: azure/[email protected]
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- uses: azure/webapps-deploy@v2
with:
app-name: 'mpplabajep-test'
images: mpplabajep.azurecr.io/techexcel/dotnetcoreapp:${{github.run_number}}
deploy-to-prod:
runs-on: ubuntu-latest
needs: deploy-to-test
environment:
name: prod
url: https://mpplabajep-prod.azurewebsites.net/
steps:
- uses: actions/checkout@v3
- name: 'Login via Azure CLI'
uses: azure/[email protected]
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- uses: azure/webapps-deploy@v2
with:
app-name: 'mpplabajep-prod'
images: mpplabajep.azurecr.io/techexcel/dotnetcoreapp:${{github.run_number}}