File tree 2 files changed +37
-9
lines changed
2 files changed +37
-9
lines changed Original file line number Diff line number Diff line change 5
5
branches : [ master ]
6
6
pull_request :
7
7
branches : [ master ]
8
+ workflow_dispatch : {}
8
9
9
10
jobs :
10
11
build :
11
-
12
12
runs-on : ubuntu-latest
13
-
13
+ permissions :
14
+ packages : write
15
+ contents : read
16
+ env :
17
+ IMAGE_NAME : ghcr.io/${{ github.repository }}
18
+ PUBLISH : ${{ github.ref == 'refs/heads/master' }}
14
19
steps :
15
20
- uses : actions/checkout@v2
16
- - name : Setup .NET 7
17
- uses : actions/setup-dotnet@v1
21
+ - uses : docker/setup-buildx-action@v2
22
+ id : buildx
23
+ with :
24
+ install : true
25
+ version : latest
26
+ - uses : docker/login-action@v2
27
+ if : ${{ env.PUBLISH }}
28
+ with :
29
+ registry : ghcr.io
30
+ username : ${{ github.actor }}
31
+ password : ${{ secrets.GITHUB_TOKEN }}
32
+ - id : meta
33
+ uses : docker/metadata-action@v4
34
+ with :
35
+ images : ${{ env.IMAGE_NAME }}
36
+ tags : |
37
+ type=sha
38
+ type=edge
39
+ type=raw,value=latest,enable={{is_default_branch}}
40
+ - uses : docker/build-push-action@v3
41
+ id : build
18
42
with :
19
- dotnet-version : 7.0.100-rc.1.22431.12
20
- - name : Install dependencies
21
- run : dotnet restore
22
- - name : Build
23
- run : dotnet build --configuration Release --no-restore
43
+ file : Dockerfile
44
+ context : .
45
+ push : ${{ env.PUBLISH }}
46
+ tags : ${{ steps.meta.outputs.tags }}
47
+ labels : ${{ steps.meta.outputs.labels }}
Original file line number Diff line number Diff line change @@ -11,4 +11,8 @@ RUN dotnet publish -c release -o /app
11
11
FROM mcr.microsoft.com/dotnet/aspnet:7.0
12
12
WORKDIR /app
13
13
COPY --from=build /app ./
14
+
15
+ LABEL org.opencontainers.image.source=https://github.com/tobyash86/WebGoat.NET
16
+ LABEL org.opencontainers.image.description="WebGoat.NETCore - port of original WebGoat.NET to .NET Core"
17
+
14
18
ENTRYPOINT ["dotnet" , "WebGoat.NET.dll" ]
You can’t perform that action at this time.
0 commit comments