-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1ac9a45
commit b2a063a
Showing
4 changed files
with
68 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
on: | ||
push: | ||
branches: | ||
- master | ||
paths: | ||
- "src/webapi/**" | ||
- "src/common/**" | ||
- ".github/workflows/webapi-docker.yml" | ||
|
||
env: | ||
IMAGE_VERSION: "1" | ||
IMAGE_TAG: "${{ github.sha }}" | ||
IMAGE_NAME: prenaissance/pricing-tf-webapi | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Login to Docker Hub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: prenaissance | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
- name: Build and push Docker image | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
file: ./src/webapi/Dockerfile | ||
push: true | ||
tags: | | ||
${{ env.IMAGE_NAME }}:${{ env.IMAGE_VERSION }} | ||
${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }} | ||
${{ env.IMAGE_NAME }}:latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build | ||
COPY src/common/PricingTf.Common.fsproj src/common/PricingTf.Common.fsproj | ||
COPY src/webapi/PricingTf.WebApi.csproj src/webapi/PricingTf.WebApi.csproj | ||
RUN dotnet restore src/webapi | ||
COPY src/common src/common | ||
COPY src/webapi src/webapi | ||
RUN dotnet publish src/webapi -c Release -o /out | ||
|
||
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS runtime | ||
WORKDIR /app | ||
COPY --from=build /out . | ||
EXPOSE 8080 | ||
ENTRYPOINT ["dotnet", "PricingTf.WebApi.dll"] |