fix: concurrency control #2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy Storybook to GitHub Pages | |
on: | |
push: | |
branches: | |
- main | |
release: | |
types: [published] | |
concurrency: | |
group: storybook-deploy | |
cancel-in-progress: true | |
permissions: | |
contents: write | |
pages: write | |
id-token: write | |
jobs: | |
# Job 1: Build Storybook | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
# Checkout repository code | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
# Setup Node.js (v22) | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '22' | |
cache: 'npm' | |
# Install dependencies | |
- name: Install dependencies | |
run: npm install | |
# Build Storybook | |
- name: Build Storybook | |
run: npm run build-storybook | |
# Upload artifact for deployment | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v2 | |
with: | |
path: storybook-static | |
# Job 2: Deploy to GitHub Pages | |
deploy: | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
# Deploy Storybook to GitHub Pages | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v2 |