Add build workflow

This commit is contained in:
Liza 2023-02-12 22:24:22 +01:00
parent 9c0699bf2c
commit a39eaa11f1
3 changed files with 26 additions and 2 deletions

24
.github/workflows/build.yml vendored Normal file
View File

@ -0,0 +1,24 @@
name: Build Client & Server
on:
push:
paths:
- 'Pal.Client/**'
- 'Pal.Common/**'
- 'Pal.Server/**'
- 'vendor/**'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup .NET SDK
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0
- name: Install dependencies
run: dotnet restore
- name: Build
run: dotnet build --configuration Release --no-restore

View File

@ -25,4 +25,4 @@ jobs:
uses: docker/build-push-action@v4
with:
push: true
tags: ghcr.io/${{ github.repository_owner }}/palace-pal:latest
tags: ghcr.io/${{ github.repository_owner }}/palace-pal:latest

View File

@ -5,7 +5,7 @@ COPY Pal.Server/Pal.Server.csproj Pal.Server/
RUN dotnet restore Pal.Server/Pal.Server.csproj
COPY . ./
RUN dotnet publish Pal.Server/Pal.Server.csproj -c Release -o /dist
RUN dotnet publish Pal.Server/Pal.Server.csproj --configuration Release --no-restore -o /dist
FROM mcr.microsoft.com/dotnet/aspnet:7.0 AS runtime
EXPOSE 5415