Skip to content

chore: deploy-test

chore: deploy-test #1

Workflow file for this run

name: Build and Deploy Documentation
on:
push:
branches:
- 'deploy-test'
# Cancel any previous run (see: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#concurrency)
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
docs-job:
runs-on: ubuntu-latest
permissions:
contents: read
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
cache: "npm"
- name: Install dependencies
run: npm ci
- name: Build project
run: npm run build
- name: Generate TypeDoc documentation
run: npm run typedoc
- name: Prepare examples directory
run: |
# Remove the alias to dist (if it exists)
find examples -name "* alias" -delete
find examples -name "dist" -type l -delete
rm -rf examples/dist
# Copy the actual dist content to examples/dist
cp -r dist examples/dist
- name: Prepare docs directory
run: |
# Create docs directory and copy examples
mkdir -p docs
cp -r examples docs/
# Delete any remaining symbolic links and macOS aliases under the docs directory
find docs -type l -delete
find docs -name "* alias" -delete
- name: Validate docs directory
run: |
echo "Checking for symbolic links..."
if find docs -type l | grep -q .; then
echo "Error: Symbolic links found in docs directory"
find docs -type l
exit 1
fi
echo "Checking directory size..."
DOCS_SIZE=$(du -sb docs | cut -f1 2>/dev/null || echo "0")
if [ "$DOCS_SIZE" = "0" ]; then
# Fallback for systems without -b option (like macOS)
DOCS_SIZE_KB=$(du -sk docs | cut -f1)
DOCS_SIZE=$((DOCS_SIZE_KB * 1024))
fi
MAX_SIZE=$((1024*1024*1024*8)) # 8GB limit to be safe
if [ "$DOCS_SIZE" -gt "$MAX_SIZE" ]; then
echo "Error: docs directory is too large (${DOCS_SIZE} bytes)"
exit 1
fi
echo "docs directory size: $(du -sh docs)"
echo "docs directory is ready for upload"
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Upload to GitHub Pages
uses: actions/upload-pages-artifact@v3
with:
path: ./docs
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4