ci: publish only the web application container
All checks were successful
Caddy Manager CI build / docker (push) Successful in 2m45s
All checks were successful
Caddy Manager CI build / docker (push) Successful in 2m45s
Disable container support for tests and bump the application version to 1.2.1.
This commit is contained in:
8
.github/workflows/ci.yaml
vendored
8
.github/workflows/ci.yaml
vendored
@@ -29,8 +29,10 @@ jobs:
|
|||||||
dotnet-quality: 'ga'
|
dotnet-quality: 'ga'
|
||||||
cache: true
|
cache: true
|
||||||
cache-dependency-path: '**/packages.lock.json'
|
cache-dependency-path: '**/packages.lock.json'
|
||||||
- name: Restore dependencies
|
- name: Restore dependencies
|
||||||
run: dotnet restore --locked-mode
|
# Scoped to the web app so the test project is never restored or built here; it pulls in
|
||||||
|
# Contracts and Services through its project references. Tests run locally, not in this job.
|
||||||
|
run: dotnet restore CaddyManager/CaddyManager.csproj --locked-mode
|
||||||
- name: Application metadata
|
- name: Application metadata
|
||||||
id: metadata
|
id: metadata
|
||||||
run: |
|
run: |
|
||||||
@@ -41,7 +43,7 @@ jobs:
|
|||||||
sed -i "s/public static readonly string CommitHash = \"\[DEVELOPMENT\]\";/public static readonly string CommitHash = \"${{ steps.metadata.outputs.COMMIT_HASH }}\";/" CaddyManager/Configurations/Application/ApplicationInfo.cs
|
sed -i "s/public static readonly string CommitHash = \"\[DEVELOPMENT\]\";/public static readonly string CommitHash = \"${{ steps.metadata.outputs.COMMIT_HASH }}\";/" CaddyManager/Configurations/Application/ApplicationInfo.cs
|
||||||
- name: Publish container
|
- name: Publish container
|
||||||
run: |
|
run: |
|
||||||
dotnet publish \
|
dotnet publish CaddyManager/CaddyManager.csproj \
|
||||||
--configuration Release --os linux-musl --arch x64 \
|
--configuration Release --os linux-musl --arch x64 \
|
||||||
/t:PublishContainer -p ContainerRegistry=ghcr.io \
|
/t:PublishContainer -p ContainerRegistry=ghcr.io \
|
||||||
-p ContainerRepository=${{ github.repository }} -p:ContainerImageTags='"${{ steps.metadata.outputs.APP_VERSION }};latest"'
|
-p ContainerRepository=${{ github.repository }} -p:ContainerImageTags='"${{ steps.metadata.outputs.APP_VERSION }};latest"'
|
||||||
@@ -6,6 +6,16 @@
|
|||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
<IsPackable>false</IsPackable>
|
<IsPackable>false</IsPackable>
|
||||||
<IsTestProject>true</IsTestProject>
|
<IsTestProject>true</IsTestProject>
|
||||||
|
<!--
|
||||||
|
The test SDK makes this project an executable, so a solution wide
|
||||||
|
`dotnet publish /t:PublishContainer` containerizes it alongside the web app, pushes both
|
||||||
|
to the same repository and tag, and lets the last one to finish win. That shipped an
|
||||||
|
image whose entrypoint was the test assembly, which exits 0 without output, so the
|
||||||
|
container looked like it started and stopped for no reason.
|
||||||
|
The pipelines publish the web app project explicitly; this keeps a solution wide publish
|
||||||
|
from ever producing an image from the tests again.
|
||||||
|
-->
|
||||||
|
<EnableSdkContainerSupport>false</EnableSdkContainerSupport>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ public class ApplicationInfo
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// The version of the application, to be defined and tagged
|
/// The version of the application, to be defined and tagged
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static readonly string Version = "1.2.0";
|
public static readonly string Version = "1.2.1";
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The commit hash of the application
|
/// The commit hash of the application
|
||||||
|
|||||||
Reference in New Issue
Block a user