Add Turborepo configuration and scripts for improved monorepo management #8627
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: Lint Docs for 404s | |
| on: | |
| push: | |
| branches: [master] | |
| pull_request: | |
| branches: [master] | |
| jobs: | |
| index: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4 | |
| id: setup-node | |
| with: | |
| node-version-file: 'package.json' | |
| - uses: dorny/paths-filter@v3 | |
| id: filter | |
| with: | |
| filters: | | |
| docs: | |
| - 'docs/**' | |
| - 'includes/**' | |
| - 'platform-includes/**' | |
| dev-docs: | |
| - 'develop-docs/**' | |
| - uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| - uses: actions/cache@v4 | |
| id: cache | |
| with: | |
| path: ${{ github.workspace }}/node_modules | |
| key: node-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }} | |
| - run: yarn install --frozen-lockfile | |
| if: steps.cache.outputs.cache-hit != 'true' | |
| # Setup Turbo cache with better cache keys for builds | |
| - name: Setup Turbo cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: .turbo | |
| key: ${{ runner.os }}-turbo-build-${{ hashFiles('**/package.json', '**/turbo.json', '**/next.config.*', '**/tsconfig.json', 'docs/**', 'includes/**', 'platform-includes/**', 'develop-docs/**') }}-${{ github.sha }} | |
| restore-keys: | | |
| ${{ runner.os }}-turbo-build-${{ hashFiles('**/package.json', '**/turbo.json', '**/next.config.*', '**/tsconfig.json') }}- | |
| ${{ runner.os }}-turbo-build- | |
| ${{ runner.os }}-turbo- | |
| - run: yarn turbo run build | |
| if: steps.filter.outputs.docs == 'true' | |
| env: | |
| SENTRY_DSN: https://[email protected]/0 | |
| NEXT_PUBLIC_SENTRY_DSN: https://[email protected]/0 | |
| - run: yarn turbo run build:developer-docs | |
| if: steps.filter.outputs.dev-docs == 'true' | |
| env: | |
| SENTRY_DSN: https://[email protected]/0 | |
| NEXT_PUBLIC_SENTRY_DSN: https://[email protected]/0 | |
| - name: Start Http Server | |
| run: yarn start & | |
| if: steps.filter.outputs.docs == 'true' || steps.filter.outputs.dev-docs == 'true' | |
| env: | |
| SENTRY_DSN: https://[email protected]/0 | |
| NEXT_PUBLIC_SENTRY_DSN: https://[email protected]/0 | |
| - name: Lint 404s | |
| run: bun ./scripts/lint-404s/main.ts | |
| if: steps.filter.outputs.docs == 'true' || steps.filter.outputs.dev-docs == 'true' | |
| - name: Kill Http Server | |
| run: kill $(lsof -t -i:3000) || true | |
| if: steps.filter.outputs.docs == 'true' || steps.filter.outputs.dev-docs == 'true' | |
| continue-on-error: true |