Skip to content

Commit d101f62

Browse files
committed
in docker builds
1 parent e323480 commit d101f62

4 files changed

Lines changed: 27 additions & 33 deletions

File tree

.dockerignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
bin/
2+
obj/
3+
.idea
4+
*.DotSettings.user
5+
.vs

.github/workflows/ci-build.yml

Lines changed: 10 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@ on:
88
types: [ opened, reopened, synchronize ]
99
workflow_call:
1010
inputs:
11-
platforms:
12-
description: 'Platforms to build for'
13-
required: false
14-
type: string
1511
latest:
1612
description: 'Tag image as latest'
1713
required: false
@@ -99,37 +95,13 @@ jobs:
9995
if-no-files-found: error
10096

10197

102-
build-linux-web:
98+
build-linux-web-containers:
10399
runs-on: ubuntu-latest
104100

105101
steps:
106102
- name: Checkout
107103
uses: actions/checkout@v4
108104

109-
- name: Setup .NET SDK ${{ env.DOTNET_VERSION }}
110-
uses: actions/setup-dotnet@v4
111-
with:
112-
dotnet-version: ${{ env.DOTNET_VERSION }}
113-
114-
- name: Cache NuGet packages
115-
uses: actions/cache@v4
116-
with:
117-
path: ~/.nuget/packages
118-
key: linux-web-nuget
119-
restore-keys: |
120-
linux-web-nuget
121-
122-
- name: Publish OpenShock Web
123-
run: dotnet publish Desktop/Desktop.csproj -c Release-Web -o ./publish/Web-Linux
124-
125-
- name: Upload OpenShock Desktop Web Linux artifacts
126-
uses: actions/upload-artifact@v4
127-
with:
128-
name: OpenShock Desktop Web Linux
129-
path: publish/Web-Linux/*
130-
retention-days: 7
131-
if-no-files-found: error
132-
133105
- name: Set up Docker Buildx
134106
uses: docker/setup-buildx-action@v3
135107

@@ -165,11 +137,19 @@ jobs:
165137
push: ${{ inputs.latest || inputs.rc || (github.ref_protected && github.event_name != 'pull_request') }}
166138
tags: ${{ steps.meta.outputs.tags }}
167139
labels: ${{ steps.meta.outputs.labels }}
168-
platforms: ${{ inputs.platforms || 'linux/amd64' }}
140+
platforms: 'linux/amd64,linux/arm64'
169141
cache-from: |
170142
type=gha
171143
cache-to: |
172144
type=gha
145+
146+
- name: Upload OpenShock Desktop Web Linux artifacts
147+
uses: actions/upload-artifact@v4
148+
with:
149+
name: OpenShock Desktop Web Linux
150+
path: publish/Web-Linux/*
151+
retention-days: 7
152+
if-no-files-found: error
173153

174154
build-linux-photino:
175155
runs-on: ubuntu-latest

.github/workflows/ci-tag.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,5 @@ jobs:
4848
needs: [get-latest-tag, get-latest-rc-tag]
4949
uses: ./.github/workflows/ci-build.yml
5050
with:
51-
platforms: linux/amd64,linux/arm64
5251
latest: ${{ needs.get-latest-tag.outputs.latest-tag == github.ref_name }}
5352
rc: ${{ needs.get-latest-rc-tag.outputs.latest-rc == github.ref_name }}

Dockerfile

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,14 @@
1-
FROM mcr.microsoft.com/dotnet/aspnet:9.0-bookworm-slim AS runtime
1+
FROM mcr.microsoft.com/dotnet/sdk:9.0-bookworm-slim AS build
2+
WORKDIR /src
3+
COPY --link Desktop/*.csproj Desktop/
4+
COPY --link ModuleBase/*.csproj ModuleBase/
5+
6+
RUN dotnet restore Desktop/Desktop.csproj /p:Configuration=Release-Web
7+
8+
COPY . .
9+
RUN dotnet publish Desktop/Desktop.csproj -c Release-Web -o /publish/Web-Linux
10+
11+
FROM mcr.microsoft.com/dotnet/aspnet:9.0-bookworm-slim AS runtime
212
WORKDIR /app
313
LABEL org.opencontainers.image.authors="team@openshock.org"
414

@@ -7,6 +17,6 @@ ENV OPENSHOCK_DATA_FOLDER=/data
717
ENV HOME=$OPENSHOCK_DATA_FOLDER
818
VOLUME ["/data"]
919

10-
COPY --link ./publish/Web-Linux .
20+
COPY --link --from=build ./publish/Web-Linux .
1121

1222
ENTRYPOINT ["dotnet", "OpenShock.Desktop.dll"]

0 commit comments

Comments
 (0)