Bumped to 0.39.0 #189
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
| # Workflow for building and deploying a VitePress site to GitHub Pages | |
| name: VitePress CI/CD | |
| on: | |
| # Run on all pushes to any branch | |
| push: | |
| # Also allow manual trigger | |
| workflow_dispatch: | |
| defaults: | |
| run: | |
| working-directory: src | |
| # Sets permissions of the GITHUB_TOKEN | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| # Allow only one concurrent deployment | |
| concurrency: | |
| group: pages | |
| cancel-in-progress: false | |
| jobs: | |
| # Build job - runs on all branches | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version-file: ./src/.nvmrc | |
| cache: "npm" | |
| cache-dependency-path: "./src/package-lock.json" | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build TS | |
| run: npm run build:ts | |
| - name: Run linting (ESlint and Prettier) | |
| run: npm run lint | |
| - name: Build with VitePress | |
| run: | | |
| npm run docs:build | |
| touch docs/.vitepress/dist/.nojekyll | |
| # Upload artifact only if on main branch | |
| - name: Setup Pages | |
| if: github.ref == 'refs/heads/main' | |
| uses: actions/configure-pages@v4 | |
| - name: Upload artifact | |
| if: github.ref == 'refs/heads/main' | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: ./src/docs/.vitepress/dist | |
| # Deployment job - only runs if build job completes and we're on main branch | |
| deploy: | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| needs: build | |
| runs-on: ubuntu-latest | |
| name: Deploy | |
| # Only run this job if we're on the main branch | |
| if: github.ref == 'refs/heads/main' | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |