File tree Expand file tree Collapse file tree 3 files changed +104
-0
lines changed Expand file tree Collapse file tree 3 files changed +104
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Build and Test
2+
3+ on :
4+ push :
5+ branches : [main]
6+ pull_request :
7+ branches : [main]
8+ paths-ignore :
9+ - README.md
10+
11+ env :
12+ DOTNET_VERSION : ' 9.0.x'
13+
14+ defaults :
15+ run :
16+ working-directory : ./src/DigmaSSEServer
17+
18+ jobs :
19+ build-and-test :
20+ runs-on : ubuntu-latest
21+ steps :
22+ - uses : actions/checkout@v4
23+
24+ - name : Setup .NET
25+ uses : actions/setup-dotnet@v4
26+ with :
27+ dotnet-version : ${{ env.DOTNET_VERSION }}
28+
29+ - name : Cache NuGet
30+ uses : actions/cache@v4
31+ with :
32+ path : ~/.nuget/packages
33+ key : ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }}
34+ restore-keys : |
35+ ${{ runner.os }}-nuget-
36+
37+ - run : dotnet restore
38+ - run : dotnet build --no-restore --configuration Release
39+ - run : dotnet test --no-build --configuration Release --verbosity normal
Original file line number Diff line number Diff line change 1+ name : Publish
2+
3+ on :
4+ release :
5+ types : [released, prereleased]
6+
7+ permissions :
8+ packages : write
9+ contents : read
10+
11+ jobs :
12+ build-and-push :
13+ runs-on : ubuntu-latest
14+ steps :
15+ - name : Checkout repository
16+ uses : actions/checkout@v4
17+
18+ - name : Set up Docker Buildx
19+ uses : docker/setup-buildx-action@v3
20+
21+ - name : Login to Docker Hub
22+ uses : docker/login-action@v3
23+ with :
24+ username : ${{ secrets.DOCKERHUB_USERNAME }}
25+ password : ${{ secrets.DOCKERHUB_TOKEN }}
26+
27+ - name : Extract Docker metadata
28+ id : meta
29+ uses : docker/metadata-action@v5
30+ with :
31+ images : digmatic/digma-sse-server
32+ tags : |
33+ type=semver,pattern={{version}}
34+ type=raw,value=preview,enable=${{ github.event.release.prerelease }}
35+ type=raw,value=latest,enable=${{ !github.event.release.prerelease }}
36+
37+ - name : Build and push Docker image
38+ uses : docker/build-push-action@v5
39+ with :
40+ context : .
41+ file : ./src/DigmaSSEServer/Dockerfile
42+ push : true
43+ tags : ${{ steps.meta.outputs.tags }}
44+ labels : ${{ steps.meta.outputs.labels }}
Original file line number Diff line number Diff line change 1+ FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS base
2+ WORKDIR /app
3+ EXPOSE 80
4+ EXPOSE 443
5+
6+ FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
7+ WORKDIR /src
8+ COPY ["src/DigmaSSEServer/DigmaSSEServer.csproj" , "./" ]
9+ RUN dotnet restore "DigmaSSEServer.csproj"
10+ COPY src/DigmaSSEServer/. ./
11+ RUN dotnet build "DigmaSSEServer.csproj" -c Release -o /app/build /p:UseAppHost=false
12+
13+ FROM build AS publish
14+ RUN dotnet publish "DigmaSSEServer.csproj" -c Release -o /app/publish /p:UseAppHost=false
15+
16+ FROM base AS final
17+ WORKDIR /app
18+ COPY --from=publish /app/publish .
19+ ENV ASPNETCORE_URLS=http://+:80
20+ ENV ASPNETCORE_ENVIRONMENT=Production
21+ ENTRYPOINT ["dotnet" , "DigmaSSEServer.dll" ]
You can’t perform that action at this time.
0 commit comments