Skip to content

Commit 76d5240

Browse files
authored
Update dotnet.yml
1 parent b145733 commit 76d5240

File tree

1 file changed

+32
-2
lines changed

1 file changed

+32
-2
lines changed

.github/workflows/dotnet.yml

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,45 @@ jobs:
2222
build:
2323

2424
runs-on: ubuntu-latest
25-
25+
2626
steps:
2727
- uses: actions/checkout@v3
2828
- name: Setup .NET
2929
uses: actions/setup-dotnet@v3
30-
30+
with:
31+
dotnet-version: 8.0
32+
3133
- name: Restore dependencies
3234
run: dotnet restore ./src/Application/src/RazorPagesTestSample/RazorPagesTestSample.csproj
3335
- name: Build
3436
run: dotnet build --no-restore ./src/Application/src/RazorPagesTestSample/RazorPagesTestSample.csproj
3537
- name: Test
3638
run: dotnet test --no-build --verbosity normal ./src/Application/tests/RazorPagesTestSample.Tests/RazorPagesTestSample.Tests.csproj
39+
40+
dockerBuildPush:
41+
42+
runs-on: ubuntu-latest
43+
needs: build
44+
45+
steps:
46+
- uses: actions/checkout@v3
47+
48+
- name: Docker Login
49+
# You may pin to the exact commit or the version.
50+
# uses: docker/login-action@28218f9b04b4f3f62068d7b6ce6ca5b26e35336c
51+
uses: docker/[email protected]
52+
with:
53+
# Server address of Docker registry. If not set then will default to Docker Hub
54+
registry: ${{ secrets.ACR_LOGIN_SERVER }}
55+
# Username used to log against the Docker registry
56+
username: ${{ secrets.ACR_USERNAME }}
57+
# Password or personal access token used to log against the Docker registry
58+
password: ${{ secrets.ACR_PASSWORD }}
59+
# Log out from the Docker registry at the end of a job
60+
logout: true
61+
62+
- name: Docker Build
63+
run: docker build -t $registryName/$repositoryName:$tag --build-arg build_version=$tag $dockerFolderPath
64+
65+
- name: Docker Push
66+
run: docker push $registryName/$repositoryName:$tag

0 commit comments

Comments
 (0)