docs(add gh pages): add github pages (#354) #10
This file contains hidden or 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 Docs & Storybook | |
| on: | |
| push: | |
| branches: | |
| - master | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: pages | |
| cancel-in-progress: false | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: pnpm/action-setup@v4 | |
| with: | |
| run_install: false | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| - run: pnpm install | |
| - name: Install docs-site dependencies | |
| run: npm install | |
| working-directory: docs-site | |
| - name: Build docs-site | |
| run: npx vite build | |
| working-directory: docs-site | |
| - name: Build storybook | |
| run: pnpm run build-storybook | |
| - name: Prepare output | |
| run: | | |
| mkdir -p output/storybook | |
| cp -r docs-site/dist/* output/ | |
| cp -r storybook-static/* output/storybook/ | |
| touch output/.nojekyll | |
| - uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: output | |
| deploy: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - id: deployment | |
| uses: actions/deploy-pages@v4 |