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] on: [push, pull_request]
jobs: 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: deploy-latest:
if: ${{ github.event_name == 'push' && github.ref_type == 'branch' && github.ref_name == 'master' }} if: ${{ github.event_name == 'push' && github.ref_type == 'branch' && github.ref_name == 'master' }}
runs-on: ubuntu-latest runs-on: ubuntu-latest

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

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

Loading…
Cancel
Save