fix usage with node 20+ final #72
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 | |
| on: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| deploy-examples: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| - name: Setup Node | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: 22 | |
| - uses: pnpm/action-setup@v2 | |
| name: Install pnpm | |
| with: | |
| version: 10 | |
| run_install: true | |
| - name: Building | |
| run: | | |
| pnpm -r generate | |
| pnpm -r build | |
| - name: Deploying | |
| run: | | |
| npx viverse-cli auth login -e \${{ secrets.VIVERSE_EMAIL }} -p \${{ secrets.VIVERSE_PASSWORD }} | |
| pnpm -r run deploy | |
| docs: | |
| uses: pmndrs/docs/.github/workflows/build.yml@v2 | |
| with: | |
| mdx: "docs" | |
| libname: "viverse" | |
| icon: "⟁" | |
| home_redirect: "/getting-started/index" | |
| github: "https://github.com/pmndrs/viverse" | |
| discord: "https://discord.gg/viversecreators" | |
| llm: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| - name: Setup Node | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: 22 | |
| - uses: pnpm/action-setup@v2 | |
| name: Install pnpm | |
| with: | |
| version: 10 | |
| run_install: false | |
| - name: Generate llms.txt | |
| run: pnpm run docs:combine | |
| - name: Upload llm artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: llm | |
| path: ./llms.txt | |
| bundle-artifacts: | |
| runs-on: ubuntu-latest | |
| needs: | |
| - docs | |
| - llm | |
| steps: | |
| - name: Download Docs Artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: github-pages | |
| path: ./docs | |
| - name: Extract Docs | |
| run: tar -xf ./docs/artifact.tar -C ./docs/ | |
| - name: Download llm Artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: llm | |
| path: ./llm | |
| - name: Add llms.txt to root | |
| run: cp ./llm/llms.txt ./docs/ | |
| - name: Create deploy.tar | |
| run: tar -cf deploy.tar -C ./docs . | |
| - name: Upload Artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: deploy | |
| path: ./deploy.tar | |
| deploy-docs: | |
| needs: bundle-artifacts | |
| runs-on: ubuntu-latest | |
| permissions: | |
| pages: write # to deploy to Pages | |
| id-token: write # to verify the deployment originates from an appropriate source | |
| # Deploy to the github-pages environment | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - id: deployment | |
| uses: actions/deploy-pages@v4 | |
| with: | |
| artifact_name: deploy |