docs(x402): bump demo-2 (trove-advisor) @x402 deps to ^2.11.0 #32
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 | |
| - "crew/**" | |
| - "docs/**" # fork README's convention for doc branches | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| concurrency: | |
| group: pages-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 # Lunaria needs full git history to compute i18n diff | |
| - name: Compute deploy path | |
| id: paths | |
| env: | |
| REF: ${{ github.ref }} | |
| run: | | |
| if [ "$REF" = "refs/heads/main" ]; then | |
| echo "dest=" >> "$GITHUB_OUTPUT" | |
| echo "base=/mezo-docs/" >> "$GITHUB_OUTPUT" | |
| else | |
| BRANCH="${REF#refs/heads/}" | |
| # Sanitize: allow only [A-Za-z0-9_-]; replace everything else with '-' | |
| SAFE=$(printf '%s' "$BRANCH" | tr -c 'A-Za-z0-9_-' '-' | sed 's/--*/-/g; s/^-//; s/-$//') | |
| if [ -z "$SAFE" ]; then | |
| echo "Refusing to deploy: sanitized branch name is empty" >&2 | |
| exit 1 | |
| fi | |
| echo "dest=preview/${SAFE}" >> "$GITHUB_OUTPUT" | |
| echo "base=/mezo-docs/preview/${SAFE}/" >> "$GITHUB_OUTPUT" | |
| fi | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: "22" | |
| cache: npm | |
| - run: npm ci | |
| - name: Build Astro site | |
| env: | |
| ASTRO_SITE: https://vativ.github.io | |
| ASTRO_BASE: ${{ steps.paths.outputs.base }} | |
| # 1. process-gitbook regenerates locale MDX with correct relative | |
| # import paths (upstream's package.json build does this first). | |
| # 2. Transient commit clears the dirty working tree — Lunaria (Starlight | |
| # i18n plugin) refuses to run with uncommitted changes. Commit is | |
| # local to the runner only; never pushed. | |
| # 3. astro build renders the site to dist/. | |
| run: | | |
| npm run process-gitbook | |
| git -c user.email=ci@local -c user.name=ci commit -am "ci: regen" --allow-empty --quiet || true | |
| npx astro build | |
| - name: Deploy to gh-pages | |
| uses: peaceiris/actions-gh-pages@v4 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| publish_dir: ./dist | |
| destination_dir: ${{ steps.paths.outputs.dest }} | |
| keep_files: true | |
| user_name: github-actions[bot] | |
| user_email: github-actions[bot]@users.noreply.github.com |