fix(ci): build @hanzo/event before the docs build #504
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 to GitHub Pages | |
| on: | |
| push: | |
| branches: [main] | |
| workflow_dispatch: | |
| inputs: | |
| capture_screenshots: | |
| description: 'Capture component screenshots (slow, optional)' | |
| required: false | |
| type: boolean | |
| default: false | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: "pages" | |
| cancel-in-progress: false | |
| jobs: | |
| build: | |
| runs-on: hanzo-build-linux-amd64 | |
| timeout-minutes: 10 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v3 | |
| with: | |
| version: 9 | |
| - name: Get pnpm store directory | |
| shell: bash | |
| run: | | |
| echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV | |
| - name: Setup pnpm cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: ${{ env.STORE_PATH }} | |
| key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pnpm-store- | |
| - name: Install dependencies | |
| run: | | |
| pnpm install --no-frozen-lockfile | |
| - name: Build @hanzo/ui package | |
| run: | | |
| cd pkgs/ui && pnpm build | |
| # link-workspace-packages=true, so the app resolves @hanzo/event to | |
| # pkgs/event whatever the version range says. Its exports point at dist/, | |
| # which only exists once the package is built. | |
| - name: Build @hanzo/event package | |
| run: | | |
| cd pkgs/event && pnpm build | |
| - name: Capture screenshots (optional) | |
| if: github.event.inputs.capture_screenshots == 'true' | |
| working-directory: ./app | |
| run: pnpm capture:registry | |
| timeout-minutes: 5 | |
| - name: Build documentation | |
| working-directory: ./app | |
| run: | | |
| pnpm build | |
| touch out/.nojekyll | |
| env: | |
| NODE_ENV: production | |
| GITHUB_ACTIONS: true | |
| NEXT_PUBLIC_APP_URL: https://ui.hanzo.ai | |
| SKIP_SCREENSHOTS: true | |
| - name: Setup Pages | |
| uses: actions/configure-pages@v4 | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: ./app/out | |
| deploy: | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| runs-on: hanzo-deploy-linux-amd64 | |
| needs: build | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |