Skip to content

250 #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 45 additions & 37 deletions .github/workflows/dotnet-deploy-1.yml
Original file line number Diff line number Diff line change
@@ -1,63 +1,71 @@
name: .NET CI

env:
registryName: mpplabajep.azurecr.io
repositoryName: techexcel/dotnetcoreapp
dockerFolderPath: ./src/Application/src/RazorPagesTestSample
tag: ${{github.run_number}}

name: .NET CI/CD

on:
push:
branches: [ main ]
paths: src/Application/**
paths:
- src/Application/**
pull_request:
branches: [ main ]
paths: src/Application/**
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
dotnet-version: '8.0.x'

- name: Restore dependencies
run: dotnet restore ./src/Application/src/RazorPagesTestSample/RazorPagesTestSample.csproj
run: dotnet restore src/Application/src/RazorPagesTestSample/RazorPagesTestSample.csproj
- name: Build
run: dotnet build --no-restore ./src/Application/src/RazorPagesTestSample/RazorPagesTestSample.csproj
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

dockerBuildPush:

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: Docker Login
# You may pin to the exact commit or the version.
# uses: docker/login-action@28218f9b04b4f3f62068d7b6ce6ca5b26e35336c
uses: docker/[email protected]
- 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:
# Server address of Docker registry. If not set then will default to Docker Hub
registry: ${{ secrets.ACR_LOGIN_SERVER }}
# Username used to log against the Docker registry
username: ${{ secrets.ACR_USERNAME }}
# Password or personal access token used to log against the Docker registry
password: ${{ secrets.ACR_PASSWORD }}
# Log out from the Docker registry at the end of a job
logout: true

- name: Docker Build
run: docker build -t $registryName/$repositoryName:$tag --build-arg build_version=$tag $dockerFolderPath

- name: Docker Push
run: docker push $registryName/$repositoryName:$tag
app-name: 'mpplabajep-prod'
images: mpplabajep.azurecr.io/techexcel/dotnetcoreapp:${{github.run_number}}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
}

<h1 class="text-danger">Error.</h1>
<h2 class="text-danger">An error occurred while processing your request.</h2>
<h3 class="text-danger">An error occurred while processing your request.</h3>

@if (Model.ShowRequestId)
{
Expand Down
Loading