8000 Adds storybook to github pages by AnturK · Pull Request #163 · tgstation/tgui-core · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Adds storybook to github pages #163

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
8000 Failed to load files.
Loading
Diff view
Diff view
62 changes: 62 additions & 0 deletions .github/workflows/publish_storybook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Workflow name
name: Build and Publish Storybook to GitHub Pages

on:
# Event for the workflow to run on
push:
branches:
- "main" # Replace with the branch you want to deploy from

permissions:
contents: read
pages: write
id-token: write

# List of jobs
jobs:
retrieve_pages_url:
runs-on: ubuntu-latest
outputs:
pages_url: ${{ steps.get_url.outputs.url }}
steps:
- id: get_url
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
url=$(gh api "repos/$GITHUB_REPOSITORY/pages" --jq '.html_url')
echo "url=$url" >> "$GITHUB_OUTPUT"
deploy:
environment:
name: github-pages
url: ${{ steps.deploy.outputs.page_url }}
runs-on: ubuntu-latest
needs: retrieve_pages_url
# Job steps
steps:
# Manual Checkout
- uses: actions/checkout@v4
# Install pnpm
- name: Install pnpm
uses: pnpm/action-setup@v4
# Set up Node
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: "pnpm"
cache-dependency-path: "./pnpm-lock.yaml"
# Install dependencies
- run: pnpm install
# Build
- id: build
env:
PAGES_URL: ${{ needs.retrieve_pages_url.outputs.pages_url }}
run: pnpm build-storybook
# Upload
- uses: actions/upload-pages-artifact@v3
with:
path: "storybook-static"
# Deploy
- id: deploy
name: Deploy to GitHub Pages
uses: actions/deploy-pages@v4
4 changes: 4 additions & 0 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ const config: StorybookConfig = {
},
rsbuildFinal: (config) => {
// Customize the final Rsbuild config here
if (process.env.PAGES_URL !== undefined) {
config.output ??= {};
config.output.assetPrefix = process.env.PAGES_URL;
}
return config;
},
docs: {},
Expand Down
0