Skip to content

Commit 701984f

Browse files
trying a docker.
1 parent a16df0f commit 701984f

7 files changed

Lines changed: 75 additions & 2 deletions

File tree

.github/actions/build-server/action.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,9 @@ runs:
3434
with:
3535
path: "server/csharp-server"
3636
name: server-csharp-${{ inputs.version }}
37+
38+
- name: Upload csharp-server docker artifact
39+
uses: actions/upload-artifact@v4
40+
with:
41+
path: "server/Dockerfile"
42+
name: server-csharp-docker-${{ inputs.version }}

.github/workflows/stage-5-publish.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,30 @@ jobs:
200200
asset_content_type: "application/gzip"
201201

202202

203+
### PUBLISH DOCKER
204+
publishdocker:
205+
name: "Publish docker packages"
206+
runs-on: ubuntu-latest
207+
needs: [publish]
208+
permissions:
209+
packages: write
210+
contents: read
211+
steps:
212+
- name: "Get the artefacts"
213+
uses: actions/download-artifact@v4
214+
with:
215+
path: .
216+
name: sdk-csharp-docker-${{ inputs.version }}
217+
- run: ls -la
218+
- run: |
219+
docker build . -t ghcr.io/NHSDigital/nhsnotifysupplierserver:latest
220+
echo $CR_PAT | docker login ghcr.io -u NHSDigital --password-stdin
221+
docker push ghcr.io/NHSDigital/nhsnotifysupplierserver:latest
222+
223+
env:
224+
CR_PAT: ${{ secrets.GITHUB_TOKEN }}
225+
226+
203227
### PUBLISH NUGET
204228
publishnuget:
205229
name: "Publish nuget packages to nuget.pkg.github.com"

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ deploy: # Deploy the project artefact to the target environment @Pipeline
2424
clean:: # Clean-up project resources (main) @Operations
2525
rm -f .version
2626
(cd sdk && make clean)
27+
(cd server && make clean)
2728

2829
serve:
2930
npm run serve

sdk/_config.version.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
version: 0.2.0-20250704.123517+417d15b
1+
version: 0.2.0-20250704.123845+a16df0f

server/Dockerfile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
FROM mcr.microsoft.com/dotnet/aspnet:8.0
2+
3+
WORKDIR /App
4+
COPY csharp-server/src/nhsnotifysupplierserver/bin/Release/net8.0 .
5+
RUN mkdir -p /workspaces/nhs-notify-supplier-api/server/csharp-server/src/nhsnotifysupplierserver/wwwroot
6+
COPY csharp-server/src/nhsnotifysupplierserver/wwwroot/* /workspaces/nhs-notify-supplier-api/server/csharp-server/src/nhsnotifysupplierserver/wwwroot/
7+
RUN ls -la /workspaces/nhs-notify-supplier-api/server/csharp-server/src/nhsnotifysupplierserver/wwwroot && \
8+
pwd
9+
ENV ASPNETCORE_ENVIRONMENT="Development"
10+
ENTRYPOINT ["dotnet", "nhsnotifysupplierserver.dll"]

server/Dockerfile.latest

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Gets from the latest pre release
2+
3+
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
4+
RUN apt-get update && \
5+
apt-get install -y \
6+
jq \
7+
curl \
8+
unzip
9+
10+
RUN releases=$(curl https://api.github.com/repos/NHSDigital/nhs-notify-supplier-api/releases) && \
11+
latest=$(echo $releases | jq -r 'map(select(.prerelease)) | first | .tag_name') && \
12+
encoded=$(jq -rn --arg x $latest '$x|@uri') && \
13+
echo $latest && \
14+
url="https://github.com/NHSDigital/nhs-notify-supplier-api/releases/download/$encoded/server-csharp-$latest.zip" && \
15+
echo $url && \
16+
echo $encoded && \
17+
curl -Lo ./server.zip $url && \
18+
unzip server.zip && \
19+
cd src/nhsnotifysupplierserver && \
20+
dotnet build --configuration Release && \
21+
ls -la bin/Release/net8.0
22+
23+
FROM mcr.microsoft.com/dotnet/aspnet:8.0
24+
25+
WORKDIR /App
26+
COPY --from=build /src/nhsnotifysupplierserver/bin/Release/net8.0 .
27+
RUN mkdir -p /src/nhsnotifysupplierserver/wwwroot
28+
COPY --from=build src/nhsnotifysupplierserver/wwwroot/* /src/nhsnotifysupplierserver/wwwroot
29+
RUN ls -la /src/nhsnotifysupplierserver/wwwroot && \
30+
pwd
31+
ENV ASPNETCORE_ENVIRONMENT="Development"
32+
ENTRYPOINT ["dotnet", "nhsnotifysupplierserver.dll"]

server/_config.version.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
version: 1.1.1
1+
version: 0.2.0-20250704.123842+a16df0f

0 commit comments

Comments
 (0)