Skip to content

Commit

Permalink
Create dotnet.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
TheMysteriousStranger90 authored Oct 9, 2024
1 parent 2d0bd81 commit 438866a
Showing 1 changed file with 58 additions and 0 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# This workflow will build a .NET project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net

name: .NET

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

jobs:
build:
runs-on: ubuntu-latest

services:
sql:
image: mcr.microsoft.com/mssql/server:2022-latest
env:
SA_PASSWORD: "MyPass@word90_"
ACCEPT_EULA: "Y"
ports:
- 1433:1433
options: >-
--health-cmd "/opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P MyPass@word90_ -Q 'SELECT 1'"
--health-interval 10s
--health-timeout 10s
--health-retries 5
redis:
image: redis:latest
ports:
- 6379:6379
options: --health-cmd "redis-cli ping"

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: '8.0.x'

- name: Install dependencies
run: dotnet restore

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

- name: Test
run: dotnet test --no-restore --verbosity normal

- name: Publish
run: dotnet publish --configuration Release --no-restore --output ./publish

- name: Build Docker image
run: docker build -t fashionclothesandtrends-webapi:latest -f ./FashionClothesAndTrends.WebAPI/Dockerfile .

0 comments on commit 438866a

Please sign in to comment.