Skip to content

GitHub actions - restrict publish to main branch only #47

GitHub actions - restrict publish to main branch only

GitHub actions - restrict publish to main branch only #47

Workflow file for this run

name: Nuget-Publish
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check out
uses: actions/checkout@v2
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.200
- name: Restore tools
run: dotnet tool restore
- name: Restore dependencies
run: dotnet restore
working-directory: ./fable/Feliz.ReactSelect
- name: Build
run: dotnet build --configuration Release --no-restore
working-directory: ./fable/Feliz.ReactSelect
- name: Publish
uses: brandedoutcast/publish-nuget@v2.5.2
if: ${{ github.ref == 'refs/heads/main' }}
with:
PROJECT_FILE_PATH: fable/Feliz.ReactSelect/Feliz.ReactSelect.fsproj
NUGET_KEY: ${{secrets.NUGET_API_KEY}}