Merge pull request #432 from HarperFast/renovate/prettier-3.x-lockfile #585
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 Docusaurus to GitHub Pages | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - 'docs/**' | |
| - 'fabric/**' | |
| - 'learn/**' | |
| - 'release-notes/**' | |
| - 'src/**' | |
| - 'static/**' | |
| - 'versioned_docs/**' | |
| - 'versioned_sidebars/**' | |
| - 'docusaurus.config.ts' | |
| - 'package-lock.json' | |
| - 'package.json' | |
| - 'redirects.ts' | |
| - 'sidebars*.ts' | |
| - 'versions.json' | |
| # Allows you to run this workflow manually from the Actions tab | |
| workflow_dispatch: | |
| # Concurrency configuration to manage parallel workflow runs | |
| concurrency: | |
| group: production-deploy | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| name: Build Docusaurus | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: '24' | |
| cache: 'npm' | |
| cache-dependency-path: 'package-lock.json' | |
| - name: Install dependencies | |
| run: | | |
| echo "Installing dependencies from $(pwd)" | |
| npm ci || (echo "npm ci failed, uploading logs" && exit 1) | |
| - name: Build Docusaurus site | |
| env: | |
| DOCUSAURUS_ROUTE_BASE_PATH: ${{ vars.DOCUSAURUS_ROUTE_BASE_PATH }} | |
| DOCUSAURUS_BASE_URL: ${{ vars.DOCUSAURUS_BASE_URL }} | |
| DOCUSAURUS_URL: ${{ vars.DOCUSAURUS_URL }} | |
| ALGOLIA_APP_ID: ${{ secrets.ALGOLIA_APP_ID }} | |
| ALGOLIA_SEARCH_KEY: ${{ secrets.ALGOLIA_SEARCH_KEY }} | |
| ALGOLIA_INDEX_NAME: ${{ secrets.ALGOLIA_INDEX_NAME }} | |
| GA4_TRACKING_ID: ${{ secrets.GA4_TRACKING_ID }} | |
| run: | | |
| echo "Building Docusaurus site..." | |
| echo "Using DOCUSAURUS_ROUTE_BASE_PATH: $DOCUSAURUS_ROUTE_BASE_PATH" | |
| echo "Using DOCUSAURUS_BASE_URL: $DOCUSAURUS_BASE_URL" | |
| echo "Using DOCUSAURUS_URL: $DOCUSAURUS_URL" | |
| npm run build || (echo "Site build failed" && exit 1) | |
| - name: Upload npm logs on failure | |
| if: failure() | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: npm-logs | |
| path: | | |
| ~/.npm/_logs/ | |
| - name: Upload Build Artifact | |
| uses: actions/upload-pages-artifact@v4 | |
| with: | |
| path: build | |
| deploy: | |
| needs: build | |
| name: Deploy to GitHub Pages | |
| runs-on: ubuntu-latest | |
| permissions: | |
| pages: write | |
| id-token: write | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |