Skip to content

Commit

Permalink
ops: create a pipeline for building and deployments (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
hazeliscoding authored Jan 23, 2024
1 parent e66cf9f commit 71640ca
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/build-test-and-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: .NET CI/CD

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

jobs:
build-and-deploy:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: '5.0.x' # Specify your .NET version

- name: Restore dependencies
run: dotnet restore

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

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

- name: Pack
run: dotnet pack --no-build -c Release -o out

- name: Push to NuGet
run: dotnet nuget push out/*.nupkg -k ${{secrets.NUGET_API_KEY}} -s https://api.nuget.org/v3/index.json
if: github.ref == 'refs/heads/master' && github.event_name == 'push'

0 comments on commit 71640ca

Please sign in to comment.