1
1
name : .NET CI
2
2
3
+ env :
4
+ registryName : qkycf2fsjozsgmpnpreg.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 ]
@@ -18,10 +24,40 @@ jobs:
18
24
- uses : actions/checkout@v3
19
25
- name : Setup .NET
20
26
uses : actions/setup-dotnet@v3
21
-
27
+ with :
28
+ dotnet-version : 8.0
29
+
22
30
- name : Restore dependencies
23
31
run : dotnet restore ./src/Application/src/RazorPagesTestSample/RazorPagesTestSample.csproj
24
32
- name : Build
25
33
run : dotnet build --no-restore ./src/Application/src/RazorPagesTestSample/RazorPagesTestSample.csproj
26
34
- name : Test
27
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.qkycf2fsjozsgmpnpreg }}
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