-
Notifications
You must be signed in to change notification settings - Fork 0
72 lines (57 loc) · 1.6 KB
/
build.yml
File metadata and controls
72 lines (57 loc) · 1.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
name: Build and Test
on:
push:
branches: [main, develop]
pull_request:
branches: [main]
env:
DOTNET_VERSION: '9.0.x'
NODE_VERSION: '24.x'
CI: true
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Setup Node.js
uses: actions/setup-node@v5
with:
node-version: ${{ env.NODE_VERSION }}
cache: "npm"
cache-dependency-path: ClientApp/package-lock.json
- name: Restore dependencies
run: dotnet restore
- name: Install frontend dependencies
run: npm ci
working-directory: ./ClientApp
- name: Build frontend
run: npm run build
working-directory: ./ClientApp
- name: Build backend with CI flag
run: dotnet build --no-restore --configuration Release
env:
CI: true
- name: Test
run: dotnet test --no-build --verbosity normal --configuration Release
env:
CI: true
docker:
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build Docker image
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile
push: false
tags: pingcrm:latest
cache-from: type=gha
cache-to: type=gha,mode=max