Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
493e54b
Adding libs examples.
RossBugginsNHS Jul 8, 2025
e133dc7
Add libs action to build stage.
RossBugginsNHS Jul 8, 2025
1ea9da4
correct typo
RossBugginsNHS Jul 8, 2025
1a2f9c9
run.sh assembly names.
RossBugginsNHS Jul 8, 2025
8456653
secrets.
RossBugginsNHS Jul 8, 2025
2b497c4
CCM-11007: Fixing log destination for Splunk forwarding (#58)
sidnhs Jul 8, 2025
27b849b
Robu6/libs nuget example (#57)
RossBugginsNHS Jul 8, 2025
41e052f
rebased to main.
RossBugginsNHS Jul 8, 2025
e28c18e
merged to main.
RossBugginsNHS Jul 8, 2025
27f84d6
....
RossBugginsNHS Jul 8, 2025
ca74a4e
<<< left in
RossBugginsNHS Jul 8, 2025
be08f6d
Adding other example poc libs.
RossBugginsNHS Jul 8, 2025
dd940af
timeouts of actions increased to 10m from 3m.
RossBugginsNHS Jul 8, 2025
f446af3
Merge remote-tracking branch 'origin/main' into robu6/libs-nuget-example
RossBugginsNHS Jul 8, 2025
61e227c
version copy to abstract folder.
RossBugginsNHS Jul 8, 2025
d4088ef
version file not in libs on github.
RossBugginsNHS Jul 8, 2025
fdc7cef
find .version and print on pub.
RossBugginsNHS Jul 8, 2025
088bc42
debugging in build.
RossBugginsNHS Jul 8, 2025
699f57d
include .version in libs - artifact hidden files.
RossBugginsNHS Jul 8, 2025
beb793b
correct data nuget package name.
RossBugginsNHS Jul 9, 2025
3963ac2
correct data nuget package name and merge.
RossBugginsNHS Jul 9, 2025
6e1b60a
Trying the docker actions.
RossBugginsNHS Jul 9, 2025
a4657c9
Merge remote-tracking branch 'origin/main' into robu6/libs-nuget-example
RossBugginsNHS Jul 9, 2025
e37b32d
Trying the docker actions.
RossBugginsNHS Jul 9, 2025
cf525d1
Trying the docker actions.
RossBugginsNHS Jul 9, 2025
d1f264a
Trying the docker actions.
RossBugginsNHS Jul 9, 2025
2e8979f
Adding docker publish from artefact
RossBugginsNHS Jul 9, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .github/actions/build-libraries/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,22 @@ runs:
path: "src/server/host/bin/Release"
name: libs-host-${{ inputs.version }}
include-hidden-files: true

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build and export
uses: docker/build-push-action@v6
with:
context: src/server
file: src/server/Dockerfile
tags: |
ghcr.io/nhsdigital/libshostdocker:latest
# ghcr.io/nhsdigital/libshostdocker:${{ inputs.version }}
outputs: type=docker,dest=${{ runner.temp }}/myimage.tar

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: libs-host-docker-${{ inputs.version }}
path: ${{ runner.temp }}/myimage.tar
28 changes: 26 additions & 2 deletions .github/workflows/stage-5-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ jobs:
asset_content_type: "application/gzip"


### PUBLISH DOCKER
### PUBLISH DOCKER - THIS NEEDS CHANGING TO DO THE DOCKER BUILD IN THE BUILD STAGE AND ARTIFACT IT. SEE publishlibhostdocker below how how and the buildlibs action.
publishdocker:
name: "Publish docker packages"
runs-on: ubuntu-latest
Expand All @@ -224,7 +224,6 @@ jobs:
docker build . -t ghcr.io/nhsdigital/nhsnotifysupplierserver:latest
echo $CR_PAT | docker login ghcr.io -u nhs-notify-supplier-api --password-stdin
docker push ghcr.io/nhsdigital/nhsnotifysupplierserver:latest

env:
CR_PAT: ${{ secrets.GITHUB_TOKEN }}

Expand Down Expand Up @@ -582,3 +581,28 @@ jobs:
env:
TEST_NUGET_VERSION: ${{ steps.set-nuget-version.outputs.TEST_NUGET_VERSION }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}



### PUBLISH LIBS host docker
publishlibhostdocker:
name: "Publish libs host docker"
runs-on: ubuntu-latest
needs: [publish]
permissions:
packages: write
contents: read
steps:
- name: "Get the artefacts"
uses: actions/download-artifact@v4
with:
path: .
name: libs-host-docker-${{ inputs.version }}

- run: |
docker load --input ${{ runner.temp }}/myimage.tar
docker image ls -a
echo $CR_PAT | docker login ghcr.io -u nhs-notify-supplier-api --password-stdin
docker push ghcr.io/nhsdigital/libshostdocker:latest
env:
CR_PAT: ${{ secrets.GITHUB_TOKEN }}
30 changes: 30 additions & 0 deletions src/server/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Multi-stage Dockerfile for .NET 8 Web API
# Build stage
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
WORKDIR /src

# Copy solution and restore as distinct layers
COPY .version ./
COPY build.sh ./
COPY server.sln ./
COPY host/host.csproj ./host/
COPY abstractions/abstractions.csproj ./abstractions/
COPY data/data.csproj ./data/
COPY letter/letter.csproj ./letter/
COPY . .

RUN ./build.sh

# Runtime stage
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS final
WORKDIR /app
COPY --from=build src/host/bin/Release/net8.0/publish .

# Expose port (change if your app uses a different port)
EXPOSE 8080

# Set environment variables (optional)
# ENV ASPNETCORE_URLS=http://+:80
RUN ls -la

ENTRYPOINT ["./run.sh"]
1 change: 1 addition & 0 deletions src/server/host/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ SuppliersApi__Letters=true \
SuppliersApi__Data=true \
SuppliersApi__Assemblies__0="nhs.notify.suppliers.api.letter" \
SuppliersApi__Assemblies__1="nhs.notify.suppliers.api.data" \
ASPNETCORE_ENVIRONMENT="Development" \
dotnet nhs.notify.suppliers.api.host.dll
Loading