Files
DiunaBI/.github/workflows/build.yml
Michał Zieliński 4c734b1a69 another build fix
2025-06-02 17:41:09 +02:00

80 lines
1.9 KiB
YAML

name: BuildApp
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
jobs:
build-frontend:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install Angular CLI
run: npm install -g @angular/cli
- name: Install PNPM
run: npm install -g pnpm
- name: Install dependencies
working-directory: src/Frontend
run: pnpm install
- name: Build Angular
working-directory: src/Frontend
run: ng build --configuration=production
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: frontend
path: src/Frontend/dist
build-backend:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET 8
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Restore dependencies
working-directory: src/Backend
run: dotnet restore DiunaBI.sln
- name: Build solution
working-directory: src/Backend
run: dotnet build DiunaBI.sln --configuration Release --no-restore
- name: Publish WebAPI
working-directory: src/Backend
run: |
dotnet publish DiunaBI.WebAPI/DiunaBI.WebAPI.csproj \
--configuration Release \
--framework net8.0 \
--self-contained false \
--output ../../build/webapi
- name: Clean up sensitive files
working-directory: build/webapi
run: |
rm -f appsettings.Development.json
rm -f client_secrets.Development.json
rm -f diunabi-admin-firebase-Development.json
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: webapi
path: build/webapi