Migrate docs to our template #227
Workflow file for this run
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: 🚀 Validation Pipeline | |
| concurrency: | |
| group: ${{ github.repository }}-${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| permissions: | |
| actions: write | |
| contents: read | |
| pull-requests: write | |
| jobs: | |
| lint: | |
| name: ⬣ Biome lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: biomejs/setup-biome@v2 | |
| - run: biome ci . | |
| validate: | |
| name: 🔎 Validate | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: styfle/cancel-workflow-action@0.12.1 | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| - uses: pnpm/action-setup@v4 | |
| - run: pnpm install | |
| - run: pnpm run test | |
| build-docs: | |
| if: ${{ github.event_name == 'pull_request' }} | |
| name: Build Docs | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - uses: pnpm/action-setup@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version-file: "package.json" | |
| cache: pnpm | |
| - run: pnpm install --prefer-offline --frozen-lockfile | |
| - name: Generate docs | |
| working-directory: docs | |
| env: | |
| APP_ENV: production | |
| DOCS_BRANCH: ${{ github.event.repository.default_branch }} | |
| run: pnpm run generate:docs | |
| - name: Pack generated docs (tarball) | |
| run: tar -czf docs-generated.tgz -C docs generated-docs | |
| - name: Upload generated docs (tgz) | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: docs-generated-tgz | |
| path: docs-generated.tgz | |
| if-no-files-found: error | |
| - name: Upload versions file | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: docs-versions | |
| path: docs/app/utils/versions.ts | |
| if-no-files-found: error | |
| deploy-docs-pr-preview: | |
| if: ${{ github.event_name == 'pull_request' }} | |
| name: 🚀 Deploy Docs | |
| needs: [lint, validate, build-docs] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Download generated docs (tgz) | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: docs-generated-tgz | |
| path: . | |
| - name: Unpack generated docs into docs/ | |
| run: tar -xzf docs-generated.tgz -C docs | |
| - name: Download versions file | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: docs-versions | |
| path: docs/app/utils | |
| - uses: forge-42/fly-deploy@v1.0.0-rc.2 | |
| id: deploy | |
| env: | |
| FLY_ORG: ${{ vars.FLY_ORG }} | |
| FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} | |
| FLY_REGION: ${{ vars.FLY_REGION }} | |
| with: | |
| workspace_name: docs | |
| app_name: react-router-devtools-docs-pr-${{ github.event.number }} | |
| use_isolated_workspace: true | |
| env_vars: | | |
| APP_ENV=production | |
| GITHUB_OWNER=${{ github.repository_owner }} | |
| GITHUB_REPO=${{ github.event.repository.name }} | |
| GITHUB_REPO_URL=https://github.com/${{ github.repository }} |