Skip to content

fix(useScrollPosition): may have undefined element #29

fix(useScrollPosition): may have undefined element

fix(useScrollPosition): may have undefined element #29

Workflow file for this run

name: 🏷️ Publish and Deploy Documentation
on:
push:
tags:
- 'v*' # Only trigger when a version tag is pushed, like v1.0.0
workflow_dispatch:
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read # Publish no need to write
packages: write # Required for NPM publish
id-token: write # Required for JSR publish
steps:
# Step 1: Checkout code
- name: 📂 Checkout code
uses: actions/checkout@v4
# Step 2: Set up Node.js for npm
- name: 📦 Set up Node.js for npm
uses: actions/setup-node@v4
with:
node-version: 'lts/*'
registry-url: 'https://registry.npmjs.org' # Default to npm registry
# Step 3.1: Install dependencies
- name: 🛠️ Install dependencies
run: npm install --legacy-peer-deps
# Step 3.2: Set up Node.js and pnpm
- name: 📦 Set up Node.js and pnpm
uses: pnpm/action-setup@v4
with:
run_install: |
- recursive: true
args: [--frozen-lockfile]
# Step 4: Lint, format, and test
- name: 🎨 Lint, format, and test
run: |
pnpm run lint:fix
pnpm run format
pnpm run test:fast
npm run build
# Step 5: Publish to NPM
- name: 🚀 Publish to npm
run: npm publish --no-git-checks
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
# Step 6: Set up Node.js for GitHub Packages
- name: 🏡 Set up Node.js for GitHub Packages
uses: actions/setup-node@v4
with:
registry-url: 'https://npm.pkg.github.com'
# Step 7: Publish to GitHub Packages
- name: 🏡 Publish to GitHub Packages
run: npm publish --no-git-checks
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Step 8: Publish to JSR
- name: 🌟 Publish to JSR
run: pnpm dlx jsr publish --allow-dirty || true
deploy-docs:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
# Step 1: Checkout code
- name: 📂 Checkout code
uses: actions/checkout@v4
# Step 2: Set up Node.js and pnpm
- name: 📦 Set up Node.js and pnpm
uses: pnpm/action-setup@v4
with:
run_install: |
- recursive: true
args: [--frozen-lockfile]
# Step 3: Build and deploy documentation
- name: 📘 Build Documentation
run: |
pnpm run docs
pnpm run docs:build
# Step 4: Deploy to docs branch
- name: 🚀 Deploy to docs branch
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: docs/.vitepress/dist
branch: docs
token: ${{ secrets.GITHUB_TOKEN }}