Merge pull request #761 from Steinbeck-Lab/development #245
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: Docs Deployment - GitHub Pages | |
| # Trigger on manual dispatch or push to main branch with docs changes | |
| on: | |
| workflow_dispatch: {} | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - 'docs/**' | |
| - 'package*.json' | |
| - '.github/workflows/deploy-doc.yml' | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| pages: write | |
| id-token: write | |
| contents: read | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| # Checkout repository with full history | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| # Setup Node.js with caching | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: npm | |
| # Install dependencies with clean install | |
| - name: Install dependencies | |
| run: npm ci | |
| # Build documentation | |
| - name: Build documentation | |
| run: npm run docs:build | |
| # Verify build output exists | |
| - name: Verify build output | |
| run: | | |
| if [ ! -d "docs/.vitepress/dist" ]; then | |
| echo "Build output directory not found!" | |
| exit 1 | |
| fi | |
| ls -la docs/.vitepress/dist | |
| # Configure GitHub Pages | |
| - name: Setup Pages | |
| uses: actions/configure-pages@v4 | |
| # Upload build artifacts | |
| - name: Upload Pages artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: docs/.vitepress/dist | |
| # Deploy to GitHub Pages | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |