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 Documentation to GitHub Pages | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - 'docs/**' | |
| - '.github/workflows/deploy-docs.yml' | |
| - 'package.json' | |
| workflow_dispatch: | |
| # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| # Allow only one concurrent deployment | |
| concurrency: | |
| group: pages | |
| cancel-in-progress: false | |
| jobs: | |
| build: | |
| name: Build Documentation | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 # Needed for VitePress lastUpdated feature | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build documentation | |
| run: npm run docs:build | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: docs/.vitepress/dist | |
| deploy: | |
| name: Deploy to GitHub Pages | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| runs-on: ubuntu-latest | |
| needs: build | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 | |
| - name: Create deployment summary | |
| run: | | |
| cat >> $GITHUB_STEP_SUMMARY << EOF | |
| ### Documentation Deployed Successfully! 📚 | |
| **URL:** ${{ steps.deployment.outputs.page_url }} | |
| **Commit:** \`${{ github.sha }}\` | |
| **Deployed at:** $(date -u) | |
| #### Links | |
| - 🏠 [Home Page](${{ steps.deployment.outputs.page_url }}) | |
| - 📖 [Getting Started](${{ steps.deployment.outputs.page_url }}/guide/getting-started) | |
| - 💡 [Concepts](${{ steps.deployment.outputs.page_url }}/concepts/interactions) | |
| - 🔧 [API Reference](${{ steps.deployment.outputs.page_url }}/api/sdk-reference) | |
| EOF |