-
Notifications
You must be signed in to change notification settings - Fork 202
Add workflow for building and deploying Storybook #3933
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
name: Build Storybook | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
types: [opened, synchronize, reopened, ready_for_review] | ||
push: | ||
branches: | ||
- main | ||
|
||
permissions: {} | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version-file: extensions/ql-vscode/.nvmrc | ||
|
||
- name: Install dependencies | ||
run: | | ||
cd extensions/ql-vscode | ||
npm ci | ||
shell: bash | ||
|
||
- name: Build Storybook | ||
run: | | ||
cd extensions/ql-vscode | ||
npm run build-storybook | ||
shell: bash | ||
|
||
- name: Upload to GitHub Pages | ||
id: deployment | ||
uses: actions/upload-pages-artifact@v3 | ||
with: | ||
path: extensions/ql-vscode/storybook-static | ||
|
||
deploy: | ||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Something that confuses me here is that both the My understanding of the I'm wondering which bits can be deleted (if any) and it still works 🤷🏼 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I believe this ensures that the URL shown for the github-pages deployment is the actual URL of the Pages site. It seems like this |
||
if: github.event_name == 'push' && github.ref == 'refs/heads/main' | ||
runs-on: ubuntu-latest | ||
permissions: | ||
id-token: write | ||
pages: write | ||
needs: build | ||
steps: | ||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/deploy-pages@v4 |
Uh oh!
There was an error while loading. Please reload this page.