Skip to content

Commit

Permalink
Added storybook publish to release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Dovrol committed Feb 17, 2024
1 parent 64a8f9b commit 353f7c0
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 12 deletions.
54 changes: 42 additions & 12 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build and push nugets to github packages
name: Release nuget and storybook on GH Pages

on:
push:
Expand All @@ -11,10 +11,11 @@ env:
NUGET_ORG: https://api.nuget.org/v3/index.json

jobs:
pack-nuget:
prepare-artifacts:
runs-on: ubuntu-latest
env:
PROJECT_PATH: "src/AdaptiveBlazor/AdaptiveBlazor.csproj"
PROJECT_PATH: "src/AdaptiveBlazor/AdaptiveBlazor.csproj"
STORYBOOK_PROJECT_PATH: "src/AdaptiveBlazor.Storybook/AdaptiveBlazor.Storybook.csproj"
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand All @@ -24,6 +25,9 @@ jobs:
with:
dotnet-version: ${{ env.DOTNET_VERSION }}

- name: Install .NET WebAssembly Tools
run: dotnet workload install wasm-tools

- name: Setup node
uses: actions/setup-node@v4
with:
Expand All @@ -32,26 +36,35 @@ jobs:
- name: Restore dependencies
run: dotnet restore

- name: Build
run: dotnet build ${{ env.PROJECT_PATH }} --no-restore -c Release
- name: Build sln
run: dotnet build --no-restore -c Release

- name: Pack
run: dotnet pack ${{ env.PROJECT_PATH }} --no-build -c Release -o ./artifacts/packages
- name: Pack nugets
run: dotnet pack ${{ env.PROJECT_PATH }} --no-build -c Release -o ./artifacts/nugets

- name: Generate storybook
run: dotnet publish ${{ env.STORYBOOK_PROJECT_PATH }} -c Release -o ./artifacts/storybook -p GHPages=true

- name: Upload nugets as artifacts
uses: actions/upload-artifact@v3
with:
name: packages
path: ./artifacts/packages
name: nugets
path: ./artifacts/nugets

- name: Upload storybook as artifacts
uses: actions/upload-artifact@v3
with:
name: storybook
path: ./artifacts/storybook

push-to-nuget-org:
needs: pack-nuget
needs: prepare-artifacts
runs-on: ubuntu-latest
steps:
- name: Download packages
- name: Download nugets
uses: actions/download-artifact@v3
with:
name: packages
name: nugets

- name: Setup NuGet.exe
uses: nuget/setup-nuget@v1
Expand All @@ -60,3 +73,20 @@ jobs:

- name: Push nugets to github packages
run: nuget push "*.nupkg" -ApiKey ${{ secrets.NUGET_ORG_KEY }} -Source ${{ env.NUGET_ORG }} -SkipDuplicate

push-storybook-to-gh-pages:
needs: prepare-artifacts
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Download storybook
uses: actions/download-artifact@v3
with:
name: storybook

- name: Deploy
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: wwwroot
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<PackageReference Include="BlazingStory" Version="1.0.0-preview.24" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="8.0.1" PrivateAssets="all" />
<PackageReference Include="PublishSPAforGitHubPages.Build" Version="2.1.1" />
</ItemGroup>

<ItemGroup>
Expand Down

0 comments on commit 353f7c0

Please sign in to comment.