Merge pull request #2 from DynamoDS/addLevelOverview #5
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 to GitHub Pages | |
| on: | |
| push: | |
| branches: [master] | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: "pages" | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| # NOTE: "cache: npm" is intentionally omitted. | |
| # Restoring a stale npm cache can cause platform-specific optional | |
| # dependencies (e.g. @rollup/rollup-linux-x64-gnu) to be skipped | |
| # during `npm ci`, leading to a Vitest startup error. | |
| # See: https://github.com/npm/cli/issues/4828 | |
| - name: Install dependencies | |
| run: npm ci | |
| # Defensive guard: if the Rollup Linux native binary is still missing | |
| # after `npm ci` (known npm optional-dep bug), wipe node_modules and | |
| # reinstall from scratch so the next steps don't fail. | |
| - name: Verify Rollup native module (clean reinstall if missing) | |
| run: | | |
| node -e "require('@rollup/rollup-linux-x64-gnu')" 2>/dev/null || \ | |
| (echo "::warning::@rollup/rollup-linux-x64-gnu missing – performing clean reinstall" && \ | |
| rm -rf node_modules && npm ci) | |
| - name: Run tests | |
| run: npm test | |
| - name: Build | |
| run: npm run build | |
| - uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: dist | |
| deploy: | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| runs-on: ubuntu-latest | |
| needs: build | |
| steps: | |
| - id: deployment | |
| uses: actions/deploy-pages@v4 |