name: Deploy Storybook on: push: branches: [main] paths: - 'src/components/**' - '.storybook/**' - '.github/workflows/deploy-storybook.yml' permissions: contents: read pages: write id-token: write jobs: build-and-deploy: name: Build & Deploy Storybook runs-on: ubuntu-latest environment: name: github-pages url: ${{ steps.deployment.outputs.page_url }} steps: - uses: actions/checkout@v4 - name: Setup Node.js uses: actions/setup-node@v4 with: node-version: '18' cache: 'npm' - name: Install dependencies run: npm ci - name: Build Storybook run: npm run build-storybook - name: Setup Pages uses: actions/configure-pages@v4 - name: Upload artifact uses: actions/upload-pages-artifact@v2 with: path: './storybook-static' - name: Deploy to GitHub Pages id: deployment uses: actions/deploy-pages@v2