-
Notifications
You must be signed in to change notification settings - Fork 4
36 lines (28 loc) · 975 Bytes
/
dotnet.yml
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
name: .NET
on:
push:
branches: ["main", "controllers", "deploy"]
pull_request:
branches: ["main", "controllers", "deploy"]
jobs:
build:
env:
ASPNETCORE_ENVIRONMENT: "Development"
runs-on: self-hosted
steps:
- name: Checkout repository
uses: actions/checkout@v4 # Check out the code from the repository
- name: Setup .NET
uses: actions/setup-dotnet@v4 # Set up the .NET SDK
with:
dotnet-version: 8.0.x # Specify the exact .NET SDK version
- name: Restore dependencies
run: dotnet restore ./backend # Restore project dependencies
- name: Test
run: dotnet test --verbosity normal ./backend # Run tests
- name: Build
run: dotnet build --configuration Release ./backend --runtime linux-x64 # Build the project
- name: Deploy to server
run: |
cp -rf ./backend/bin/net8.0/linux-x64/* /home/datnt/datj-backend/
shell: bash