Skip to content

Commit

Permalink
deploy storybook to github pages
Browse files Browse the repository at this point in the history
  • Loading branch information
swantzter committed Aug 26, 2024
1 parent af0252a commit c90dd93
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 9 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Deploy Storybook

on:
release:
types: [created]
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 30
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- run: npm ci --prefer-offline --force
- run: npm run build:storybook
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: storybook-static

# Deployment job
deploy:
timeout-minutes: 30
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
10 changes: 6 additions & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@ on:

jobs:
publish-npm:
timeout-minutes: 30
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
registry-url: https://registry.npmjs.org/
Expand All @@ -23,10 +24,11 @@ jobs:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}

publish-gpr:
timeout-minutes: 30
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
registry-url: https://npm.pkg.github.com/
Expand Down
12 changes: 7 additions & 5 deletions .github/workflows/qa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@ on: [push, pull_request]

jobs:
lint:
timeout-minutes: 30
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
Expand All @@ -18,20 +19,21 @@ jobs:
- run: npm run typecheck

chromatic:
timeout-minutes: 30
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Use Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- run: npm ci --prefer-offline --force
- name: Publish to Chromatic
uses: chromaui/action@v1
uses: chromaui/action@v11
with:
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
buildScriptName: build:storybook
Expand Down

0 comments on commit c90dd93

Please sign in to comment.