generated from DFE-Digital/govuk-dotnet-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added Dockerfile at the repository root level to support docker image…
… build using Github URL
- Loading branch information
nileshgnagepatil
committed
Sep 21, 2023
1 parent
7a7c18a
commit dec7359
Showing
4 changed files
with
66 additions
and
28 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
--- | ||
name: Run regression tests | ||
on: | ||
pull_request: | ||
branches: | ||
- master | ||
- main | ||
jobs: | ||
build-test-scan: | ||
name: Build image and regression test | ||
runs-on: ubuntu-latest | ||
env: | ||
CPD_GOOGLEANALYTICSTAG: ${{secrets.TF_VAR_CPD_GOOGLEANALYTICSTAG}} | ||
CPD_SPACE_ID: ${{secrets.TF_VAR_CPD_SPACE_ID}} | ||
CPD_PREVIEW_KEY: ${{secrets.TF_VAR_CPD_PREVIEW_KEY}} | ||
CPD_DELIVERY_KEY: ${{secrets.TF_VAR_CPD_DELIVERY_KEY}} | ||
CPD_CLARITY: ${{secrets.TF_VAR_CPD_CLARITY}} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Build the Docker App Image | ||
run: cd Childrens-Social-Care-CPD; docker build https://github.com/DFE-Digital/childrens-social-care-cpd.git#Feature/ContainerizeRegressionTests --tag childrens-social-care-cpd:ContainerizeRegressionTests | ||
- name: Run the content regression tests | ||
run: cd browser-tests/content-regression-tests; docker-compose up --exit-code-from content-regression-tests | ||
|
||
- uses: actions/upload-artifact@v3 | ||
name: Playwright report | ||
if: always() | ||
with: | ||
name: playwright-report | ||
retention-days: 7 | ||
path: | | ||
${{ github.workspace }}/browser-tests/content-regression-tests/playwright-report | ||
- name: Run Tidy up | ||
if: always() | ||
run: cd browser-tests/content-regression-tests; docker-compose down --volumes |
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,26 @@ | ||
#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging. | ||
|
||
FROM mcr.microsoft.com/dotnet/aspnet:7.0 AS base | ||
WORKDIR /app | ||
EXPOSE 80 | ||
EXPOSE 443 | ||
|
||
FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build | ||
WORKDIR /src | ||
COPY ["Childrens-Social-Care-CPD.csproj", "."] | ||
RUN dotnet restore "./Childrens-Social-Care-CPD.csproj" | ||
COPY . . | ||
WORKDIR "/src/." | ||
RUN dotnet build "Childrens-Social-Care-CPD.csproj" -c Release -o /app/build | ||
|
||
FROM build AS publish | ||
RUN dotnet publish "Childrens-Social-Care-CPD.csproj" -c Release -o /app/publish | ||
|
||
FROM base AS final | ||
WORKDIR /app | ||
COPY --from=publish /app/publish . | ||
ARG VCSREF=0 | ||
ENV VCS-REF=$VCSREF | ||
ARG VCSTAG=0.0.0 | ||
ENV VCS-TAG=$VCSTAG | ||
ENTRYPOINT ["dotnet", "Childrens-Social-Care-CPD.dll"] |
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