Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 63 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Angular + .NET CI

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:

build:
runs-on: ubuntu-latest

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

# ================= ANGULAR =================
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: 'npm'
cache-dependency-path: src/frontend/package-lock.json

- name: Install Angular dependencies
working-directory: src/frontend
run: npm ci

- name: Build Angular
working-directory: src/frontend
run: npm run build -- --configuration production

# ================= .NET =================
- name: Setup .NET 9
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.0.x

- name: Restore .NET
run: dotnet restore

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

- name: Run tests
run: dotnet test --no-build --verbosity normal

# ========== Якщо Angular має бути в wwwroot ==========
- name: Copy Angular to wwwroot
run: |
rm -rf src/BackendApp/wwwroot/*
cp -r src/frontend/dist/* src/BackendApp/wwwroot/

# ================= Publish =================
- name: Publish App
run: dotnet publish src/BackendApp/BackendApp.csproj -c Release -o out

- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: app-build
path: out
Loading