Fix CLI execution through npm symlinks and release 7.0.4 #50
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: Site | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - main | |
| - next | |
| paths: | |
| - ".github/workflows/site.yml" | |
| - "apps/site/**" | |
| - "docs/**" | |
| - "packages/**" | |
| - "package-lock.json" | |
| - "package.json" | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| deployments: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| - name: Setup Node | |
| uses: actions/setup-node@v5 | |
| with: | |
| node-version: 22 | |
| cache: npm | |
| - name: Install dependencies | |
| run: npm ci --ignore-scripts | |
| - name: Check agent contracts | |
| run: npm run test:unit -- scripts/agent-site.test.mjs | |
| - name: Check site types | |
| run: npm --workspace @chart-kit/site run check | |
| - name: Build site | |
| run: npm run site:build | |
| - name: Ensure Cloudflare Pages production branch | |
| run: | | |
| curl --fail --silent --show-error --request PATCH \ | |
| "https://api.cloudflare.com/client/v4/accounts/${{ secrets.CLOUDFLARE_ACCOUNT_ID }}/pages/projects/chartkit-io" \ | |
| --header "Authorization: Bearer ${{ secrets.CLOUDFLARE_API_TOKEN }}" \ | |
| --header "Content-Type: application/json" \ | |
| --data '{"production_branch":"main"}' \ | |
| --output /dev/null | |
| - name: Deploy to Cloudflare Pages | |
| id: cloudflare-pages | |
| uses: cloudflare/wrangler-action@v3 | |
| with: | |
| apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
| accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
| wranglerVersion: "4" | |
| command: pages deploy apps/site/dist --project-name=chartkit-io --branch=${{ github.ref_name }} | |
| gitHubToken: ${{ secrets.GITHUB_TOKEN }} |