diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml new file mode 100644 index 0000000..448686d --- /dev/null +++ b/.github/workflows/ci-cd.yml @@ -0,0 +1,25 @@ +name: ASP.NET Core 8 API CI/CD +on: + push: + branches:[main] + +jobs: + build: # Fisrt we we will setup only build job + runs-on: ubuntu-latest # <-- OS to run the job + + steps: + - name: Checlout-code # Step 1: Checkout the code from repository + uses: actions/checkout@v3 # This is a predefined action in GutHib to checkout code + + - name: Setup .NET 8 SDK # Step 2: we will setup .net 8 sdk for build + uses: actions/setup-dotnet@v3 # Predefined action to setup dotnet + with: #<-- provide parameters to the action + dotnet-version: '8.0.x' # Specify the .NET version to install + + - name: Restore dependencies # Step 3: Restore the dependencies + run: dotnet restore + + - name: Build solution # Step 4: Build the solution + run: dotnet build --no-restore --configuration Release + +