From a39eaa11f1ea44444829a01eb78c6f420c1ed9e5 Mon Sep 17 00:00:00 2001 From: Liza Carvelli Date: Sun, 12 Feb 2023 22:24:22 +0100 Subject: [PATCH] Add build workflow --- .github/workflows/build.yml | 24 ++++++++++++++++++++++++ .github/workflows/server.yml | 2 +- Dockerfile | 2 +- 3 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..b02bd02 --- /dev/null +++ b/.github/workflows/build.yml @@ -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 diff --git a/.github/workflows/server.yml b/.github/workflows/server.yml index afee0c6..3e80278 100644 --- a/.github/workflows/server.yml +++ b/.github/workflows/server.yml @@ -25,4 +25,4 @@ jobs: uses: docker/build-push-action@v4 with: push: true - tags: ghcr.io/${{ github.repository_owner }}/palace-pal:latest \ No newline at end of file + tags: ghcr.io/${{ github.repository_owner }}/palace-pal:latest diff --git a/Dockerfile b/Dockerfile index b52a582..f7dc162 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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