docs: enable copy code #22
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 Docs to Github Pages | |
| # Github actions for Turborepos | |
| # ref: https://turborepo.com/docs/guides/ci-vendors/github-actions | |
| on: | |
| push: | |
| branches: ["main"] | |
| paths: ["apps/docs/**"] | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| timeout-minutes: 15 | |
| runs-on: ubuntu-latest | |
| # Turborepo remote cache | |
| # ref: https://turborepo.com/docs/guides/ci-vendors/github-actions#remote-caching | |
| env: | |
| TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }} | |
| TURBO_TEAM: ${{ secrets.TURBO_TEAM }} | |
| steps: | |
| - name: Check out code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 2 | |
| - uses: pnpm/action-setup@v3 | |
| with: | |
| version: 9 | |
| - name: Setup Node.js environment | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 23 | |
| cache: "pnpm" | |
| - name: Install dependencies | |
| run: pnpm install | |
| # Turbo filter for docs app and it's dependencies | |
| # ref: https://turborepo.com/docs/crafting-your-repository/running-tasks#filtering-to-include-dependencies | |
| - name: Build | |
| run: pnpm build --filter=./apps/docs... | |
| # Upload static files as artifact to deploy to github pages | |
| # ref: https://github.com/actions/upload-pages-artifact | |
| - name: Upload static files as artifact | |
| id: deployment | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: apps/docs/dist/ | |
| # Deploy to github pages | |
| # ref: https://github.com/actions/deploy-pages | |
| deploy: | |
| needs: build | |
| permissions: | |
| pages: write | |
| id-token: write | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |