Re-add the Docker build job on GitHub Actions

pull/1032/head
Tyrrrz 2 years ago
parent 72bb886a5e
commit e261edde8b

@ -3,6 +3,30 @@ name: docker
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build image
run: >
docker buildx build
--file DiscordChatExporter.Cli.dockerfile
--platform linux/amd64,linux/arm64
--output docker/
.
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: DiscordChatExporter.Cli.Docker
path: docker/
deploy-latest:
if: ${{ github.event_name == 'push' && github.ref_type == 'branch' && github.ref_name == 'master' }}
runs-on: ubuntu-latest

@ -59,26 +59,26 @@ jobs:
- name: Publish (CLI)
run: >
dotnet publish DiscordChatExporter.Cli
--output DiscordChatExporter.Cli/bin/Publish/
--output DiscordChatExporter.Cli/publish/
--configuration Release
- name: Publish (GUI)
run: >
dotnet publish DiscordChatExporter.Gui
--output DiscordChatExporter.Gui/bin/Publish/
--output DiscordChatExporter.Gui/publish/
--configuration Release
- name: Upload artifacts (CLI)
uses: actions/upload-artifact@v3
with:
name: DiscordChatExporter.Cli
path: DiscordChatExporter.Cli/bin/Publish/
path: DiscordChatExporter.Cli/publish/
- name: Upload artifacts (GUI)
uses: actions/upload-artifact@v3
with:
name: DiscordChatExporter
path: DiscordChatExporter.Gui/bin/Publish/
path: DiscordChatExporter.Gui/publish/
deploy:
if: ${{ github.event_name == 'push' && github.ref_type == 'tag' }}

@ -14,11 +14,11 @@ ARG TARGETARCH
WORKDIR /build
COPY favicon.ico ./
COPY NuGet.config ./
COPY Directory.Build.props ./
COPY DiscordChatExporter.Core ./DiscordChatExporter.Core
COPY DiscordChatExporter.Cli ./DiscordChatExporter.Cli
COPY favicon.ico .
COPY NuGet.config .
COPY Directory.Build.props .
COPY DiscordChatExporter.Core DiscordChatExporter.Core
COPY DiscordChatExporter.Cli DiscordChatExporter.Cli
# Publish a self-contained assembly so we can use a slimmer runtime image
RUN dotnet publish DiscordChatExporter.Cli \
@ -26,7 +26,7 @@ RUN dotnet publish DiscordChatExporter.Cli \
--self-contained \
--use-current-runtime \
--arch $TARGETARCH \
--output ./publish
--output publish/
# -- Run
# Use `runtime-deps` instead of `runtime` because we have a self-contained assembly

Loading…
Cancel
Save