Deploy GitHub Pages #171
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 GitHub Pages | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - 'gh-pages/**' | |
| - 'FEATURES.md' | |
| - 'CHANGELOG.md' | |
| - 'PRIVACY.md' | |
| - 'docs/INSTALLATION.md' | |
| - 'docs/INSTALLATION-MCP-SERVER.md' | |
| - 'docs/INSTALLATION-CLI.md' | |
| - 'docs/CONTRIBUTING.md' | |
| - 'SECURITY.md' | |
| - 'src/ExcelMcp.McpServer/README.md' | |
| - 'src/ExcelMcp.CLI/README.md' | |
| - 'skills/README.md' | |
| - '.github/workflows/deploy-gh-pages.yml' | |
| - 'scripts/Update-StarHistory.ps1' | |
| schedule: | |
| - cron: "17 3 * * *" | |
| 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: | |
| deploy: | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| - name: Generate star history chart | |
| shell: pwsh | |
| env: | |
| STAR_HISTORY_TOKEN: ${{ github.token }} | |
| run: > | |
| ./scripts/Update-StarHistory.ps1 | |
| -Repository '${{ github.repository }}' | |
| -Token $env:STAR_HISTORY_TOKEN | |
| -OutputPath './gh-pages/docs/assets/images/star-history.svg' | |
| - name: Setup Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.13' | |
| cache: pip | |
| cache-dependency-path: gh-pages/requirements.txt | |
| - name: Install dependencies | |
| run: pip install -r gh-pages/requirements.txt | |
| - name: Build with MkDocs | |
| working-directory: gh-pages | |
| run: mkdocs build --strict --clean | |
| - name: Setup Pages | |
| uses: actions/configure-pages@v6 | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v5 | |
| with: | |
| path: 'gh-pages/_site' | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v5 | |
| - name: Notify IndexNow (Bing/Yandex) | |
| run: | | |
| # Get list of all HTML pages from the built site (excluding 404.html which should not be indexed) | |
| cd gh-pages/_site | |
| URLS=$(find . -name "*.html" -type f ! -name "404.html" | sed 's|^\./||' | sed 's|index\.html$||' | sed 's|^|https://excelmcpserver.dev/|' | jq -R -s -c 'split("\n") | map(select(length > 0))') | |
| # Submit to IndexNow API | |
| curl -X POST "https://api.indexnow.org/IndexNow" \ | |
| -H "Content-Type: application/json; charset=utf-8" \ | |
| -d "{ | |
| \"host\": \"excelmcpserver.dev\", | |
| \"key\": \"2049c837880704706739672b0ca752f9\", | |
| \"keyLocation\": \"https://excelmcpserver.dev/2049c837880704706739672b0ca752f9.txt\", | |
| \"urlList\": $URLS | |
| }" \ | |
| --fail-with-body || echo "IndexNow notification failed (non-critical)" |