From 8ee56a40c59803ce253c17b7492c6f5cd4f61e36 Mon Sep 17 00:00:00 2001 From: sjoerdbeentjes <11621275+sjoerdbeentjes@users.noreply.github.com> Date: Wed, 1 Jul 2026 15:07:52 +0200 Subject: [PATCH] ci: deploy Storybooks to GitHub Pages Adds a workflow that builds both packages' Storybooks and publishes them under /react/ and /angular/ on one GitHub Pages site (Pages only supports one deployment per repo), with a small root index linking to each. --- .github/workflows/deploy-storybook.yml | 79 ++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 .github/workflows/deploy-storybook.yml diff --git a/.github/workflows/deploy-storybook.yml b/.github/workflows/deploy-storybook.yml new file mode 100644 index 0000000..2f4d64b --- /dev/null +++ b/.github/workflows/deploy-storybook.yml @@ -0,0 +1,79 @@ +name: Deploy Storybooks + +# Builds both packages' Storybooks and publishes them to GitHub Pages under +# /react/ and /angular/ on the same site (Pages only supports one deployment +# per repo, so both live side by side rather than as separate sites). +on: + push: + branches: [main] + workflow_dispatch: + +concurrency: + group: pages + cancel-in-progress: false + +permissions: + contents: read + pages: write + id-token: write + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: pnpm/action-setup@v4 + + - uses: actions/setup-node@v4 + with: + node-version-file: .nvmrc + cache: pnpm + + - uses: actions/cache@v4 + with: + path: .turbo + key: turbo-${{ runner.os }}-${{ github.sha }} + restore-keys: | + turbo-${{ runner.os }}- + + - run: pnpm install --frozen-lockfile + + # Builds both storybook-static outputs; turbo resolves ^build deps + # (@surfnet/tokens, @surfnet/contracts) automatically. + - run: pnpm build-storybook + + - name: Assemble Pages site + run: | + mkdir -p site/react site/angular + cp -r packages/react/storybook-static/. site/react/ + cp -r packages/angular/storybook-static/. site/angular/ + cat > site/index.html <<'EOF' + + +
+ +