Skip to content

Commit

Permalink
We build in docker, fuck github
Browse files Browse the repository at this point in the history
  • Loading branch information
LucHeart committed Jun 20, 2024
1 parent 78c3e12 commit cc01243
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 34 deletions.
33 changes: 0 additions & 33 deletions .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,41 +18,8 @@ env:
REGISTRY: ghcr.io

jobs:

build:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup .NET SDK ${{ env.DOTNET_VERSION }}
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}

- name: Install dependencies
run: dotnet restore

- name: Build
run: dotnet build --configuration Release --no-restore

- name: Test
run: dotnet test --no-restore --verbosity normal

- name: Publish Discord Bot
run: dotnet publish DiscordBot/DiscordBot.csproj -c Release -o ./publish/DiscordBot

- name: Upload Discord Bot artifacts
uses: actions/upload-artifact@v4
with:
name: DiscordBot
path: publish/DiscordBot/*
retention-days: 1
if-no-files-found: error

containerize:
runs-on: ubuntu-latest
needs: build

steps:
Expand Down
12 changes: 11 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
FROM mcr.microsoft.com/dotnet/sdk:8.0-alpine AS build
WORKDIR /src
COPY *.sln .
COPY DiscordBot/*.csproj ./DiscordBot/
RUN dotnet restore

COPY . .
RUN dotnet publish -c Release -o /publish --no-restore


FROM mcr.microsoft.com/dotnet/runtime:8.0-alpine
WORKDIR /app
COPY publish .
COPY --from=build /publish .
RUN apk add --no-cache icu-libs

ENTRYPOINT ["dotnet", "OpenShock.DiscordBot.dll"]

0 comments on commit cc01243

Please sign in to comment.