Deploy website + docs #24
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 site | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - 'docs/**' | |
| - 'marketing/**' | |
| - 'CHANGELOG.md' | |
| - 'MIGRATION.md' | |
| - 'CONTRIBUTING.md' | |
| - 'ROADMAP.md' | |
| - 'llms.txt' | |
| - 'sceneview/Module.md' | |
| - 'arsceneview/Module.md' | |
| release: | |
| types: [published] | |
| workflow_dispatch: | |
| jobs: | |
| deploy: | |
| name: Build and deploy | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.x' | |
| - name: Install dependencies | |
| run: | | |
| pip install mkdocs-material | |
| pip install mkdocs-social-plugin || true | |
| - name: Sync content into docs | |
| run: | | |
| # Codelabs from marketing (skip if missing) | |
| if [ -d marketing/codelabs ]; then | |
| mkdir -p docs/docs/codelabs | |
| cp marketing/codelabs/codelab-3d-compose.md docs/docs/codelabs/codelab-3d-compose.md 2>/dev/null || true | |
| cp marketing/codelabs/codelab-ar-compose.md docs/docs/codelabs/codelab-ar-compose.md 2>/dev/null || true | |
| fi | |
| # Root docs | |
| cp MIGRATION.md docs/docs/migration.md 2>/dev/null || true | |
| cp CHANGELOG.md docs/docs/changelog.md 2>/dev/null || true | |
| cp CONTRIBUTING.md docs/docs/contributing.md 2>/dev/null || true | |
| - name: Build site | |
| run: mkdocs build --config-file docs/mkdocs.yml --site-dir site | |
| - name: Copy extra site files | |
| run: | | |
| # Copy extra files if they exist | |
| for f in robots.txt manifest.json structured-data.json llms.txt llms-full.txt; do | |
| [ -f "docs/docs/$f" ] && cp "docs/docs/$f" "site/$f" || true | |
| done | |
| # Security policy | |
| mkdir -p site/.well-known | |
| if [ -f "docs/docs/.well-known/security.txt" ]; then | |
| cp docs/docs/.well-known/security.txt site/.well-known/security.txt | |
| fi | |
| # Ensure GitHub Pages doesn't process with Jekyll | |
| touch site/.nojekyll | |
| # Verify the build produced content | |
| FILE_COUNT=$(find site -type f | wc -l) | |
| echo "Site contains $FILE_COUNT files" | |
| if [ "$FILE_COUNT" -lt 10 ]; then | |
| echo "ERROR: Site build produced fewer than 10 files. Aborting deploy." | |
| exit 1 | |
| fi | |
| - name: Deploy to GitHub Pages | |
| uses: peaceiris/actions-gh-pages@v4 | |
| with: | |
| personal_token: ${{ secrets.PERSONAL_TOKEN }} | |
| external_repository: SceneView/sceneview.github.io | |
| publish_branch: main | |
| publish_dir: ./site | |
| destination_dir: . | |
| full_commit_message: 'Deploy docs site — ${{ github.sha }}' | |
| enable_jekyll: false |