File tree Expand file tree Collapse file tree 2 files changed +43
-1
lines changed
src/Application/src/RazorPagesTestSample Expand file tree Collapse file tree 2 files changed +43
-1
lines changed Original file line number Diff line number Diff line change 15
15
workflow_dispatch :
16
16
17
17
18
+ env :
19
+ registryName : " q3zpru2gmy754mpnpreg.azurecr.io" # Replace registryName with the name of your registry
20
+ repositoryName : " techexcel/dotnetcoreapp"
21
+ dockerFolderPath : " src/Application/src/RazorPagesTestSample"
22
+ tag : ${{ github.run_number }}
23
+
18
24
jobs :
19
25
build :
20
26
31
37
- name : Build
32
38
run : dotnet build src/Application/src/RazorPagesTestSample/RazorPagesTestSample.csproj --no-restore
33
39
- name : Test
34
- run : dotnet test src/Application/tests/RazorPagesTestSample.Tests/RazorPagesTestSample.Tests.csproj --no-build --verbosity normal
40
+ run : dotnet test src/Application/tests/RazorPagesTestSample.Tests/RazorPagesTestSample.Tests.csproj --no-build --verbosity normal
41
+
42
+ buildacr :
43
+ runs-on : ubuntu-latest
44
+
45
+ steps :
46
+ - uses : actions/checkout@v4
47
+
48
+ - name : Login to Azure Container Registry
49
+ run : echo "${{ secrets.ACR_PASSWORD }}" | docker login ${{ env.registryName }} -u ${{ secrets.ACR_USERNAME }} --password-stdin
50
+
51
+ - name : Build and push Docker image
52
+ run : |
53
+ docker build ${{ env.dockerFolderPath }} -t ${{ env.registryName }}/${{ env.repositoryName }}:${{ env.tag }}
54
+ docker push ${{ env.registryName }}/${{ env.repositoryName }}:${{ env.tag }}
Original file line number Diff line number Diff line change
1
+ # Update the base and SDK images to .NET 8
2
+ FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
3
+ WORKDIR /app
4
+ EXPOSE 8080
5
+ EXPOSE 8081
6
+
7
+
8
+ FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
9
+ WORKDIR /src
10
+ COPY ["RazorPagesTestSample.csproj" , "./" ]
11
+ RUN dotnet restore "./RazorPagesTestSample.csproj"
12
+ COPY . .
13
+ WORKDIR "/src/."
14
+ RUN dotnet build "RazorPagesTestSample.csproj" -c Release -o /app/build
15
+
16
+ FROM build AS publish
17
+ RUN dotnet publish "RazorPagesTestSample.csproj" -c Release -o /app/publish
18
+
19
+ FROM base AS final
20
+ WORKDIR /app
21
+ COPY --from=publish /app/publish .
22
+ ENTRYPOINT ["dotnet" , "RazorPagesTestSample.dll" ]
You can’t perform that action at this time.
0 commit comments