1
1
name : .NET CI
2
2
3
+ env :
4
+ registryName : mpplabajep.azurecr.io
5
+ repositoryName : techexcel/dotnetcoreapp
6
+ dockerFolderPath : ./src/Application/src/RazorPagesTestSample
7
+ tag : ${{github.run_number}}
8
+
3
9
on :
4
10
push :
5
11
branches : [ main ]
6
- paths :
7
- - src/Application/**
12
+ paths : src/Application/**
8
13
pull_request :
9
14
branches : [ main ]
10
- paths :
11
- - src/Application/**
15
+ paths : src/Application/**
12
16
# Allows you to run this workflow manually from the Actions tab
13
17
workflow_dispatch :
14
18
jobs :
@@ -21,11 +25,39 @@ jobs:
21
25
- name : Setup .NET
22
26
uses : actions/setup-dotnet@v3
23
27
with :
24
- dotnet-version : ' 8.0.x '
25
-
28
+ dotnet-version : 8.0
29
+
26
30
- name : Restore dependencies
27
31
run : dotnet restore ./src/Application/src/RazorPagesTestSample/RazorPagesTestSample.csproj
28
32
- name : Build
29
33
run : dotnet build --no-restore ./src/Application/src/RazorPagesTestSample/RazorPagesTestSample.csproj
30
34
- name : Test
31
- run : dotnet test --no-build --verbosity normal ./src/Application/tests/RazorPagesTestSample.Tests/RazorPagesTestSample.Tests.csproj
35
+ run : dotnet test --no-build --verbosity normal ./src/Application/tests/RazorPagesTestSample.Tests/RazorPagesTestSample.Tests.csproj
36
+
37
+ dockerBuildPush :
38
+
39
+ runs-on : ubuntu-latest
40
+ needs : build
41
+
42
+ steps :
43
+ - uses : actions/checkout@v3
44
+
45
+ - name : Docker Login
46
+ # You may pin to the exact commit or the version.
47
+ # uses: docker/login-action@28218f9b04b4f3f62068d7b6ce6ca5b26e35336c
48
+
49
+ with :
50
+ # Server address of Docker registry. If not set then will default to Docker Hub
51
+ registry : ${{ secrets.ACR_LOGIN_SERVER }}
52
+ # Username used to log against the Docker registry
53
+ username : ${{ secrets.ACR_USERNAME }}
54
+ # Password or personal access token used to log against the Docker registry
55
+ password : ${{ secrets.ACR_PASSWORD }}
56
+ # Log out from the Docker registry at the end of a job
57
+ logout : true
58
+
59
+ - name : Docker Build
60
+ run : docker build -t $registryName/$repositoryName:$tag --build-arg build_version=$tag $dockerFolderPath
61
+
62
+ - name : Docker Push
63
+ run : docker push $registryName/$repositoryName:$tag
0 commit comments