Merge pull request #16 from ob1-s/feat/ci-sim-render #45
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: uDuck CI | |
| on: | |
| push: | |
| branches: [main, master] | |
| pull_request: | |
| branches: [main, master] | |
| permissions: | |
| contents: read | |
| jobs: | |
| validate: | |
| name: Validate Registry & Build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Code | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| persist-credentials: false | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6.0.10 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 | |
| with: | |
| node-version: 22 | |
| cache: 'pnpm' | |
| - name: Install Dependencies | |
| run: pnpm install --frozen-lockfile --ignore-scripts | |
| - name: Validate Registry | |
| run: pnpm validate | |
| - name: Run Vitest Suite | |
| run: pnpm test | |
| - name: Compile Public Registry Index | |
| run: pnpm compile | |
| - name: Snapshot-diff generated catalog | |
| run: | | |
| if ! git diff --exit-code -- public/registry.json README.md; then | |
| echo "::error::Generated catalog is stale — run 'pnpm compile' and commit the result." | |
| exit 1 | |
| fi | |
| - name: Build Web Application | |
| run: pnpm build | |
| - name: Deploy to Cloudflare Pages | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
| uses: cloudflare/wrangler-action@v4 | |
| with: | |
| apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
| accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
| packageManager: npm | |
| wranglerVersion: "4.127.1" | |
| workingDirectory: ${{ runner.temp }} | |
| command: pages deploy ${{ github.workspace }}/out --project-name=uduck-registry |