-
-
Notifications
You must be signed in to change notification settings - Fork 6
34 lines (33 loc) · 962 Bytes
/
build.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
name: Build
on:
push:
branches: [ main ]
tags:
- v*
pull_request:
branches: [ main ]
env:
IMAGE_NAME: netcoreboilerplate
jobs:
build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Setup .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
dotnet-quality: 'preview'
- name: Install dependencies
run: dotnet restore
- name: Build
run: dotnet build --configuration Release --no-restore
- name: Build Docker Image
run: dotnet publish DockerNetExample --os linux --arch x64 /t:PublishContainer -c Release
- name: Up Service
run: docker compose up -d
- name: Test Service
run: curl --connect-timeout 5 --max-time 10 --retry 5 --retry-delay 0 --retry-all-errors --retry-max-time 60 --location 'http://localhost:8000/WeatherForecast'
- name: Stop Service
if: always()
run: docker compose down