Skip to content

Publish shared v2 packages #6

Publish shared v2 packages

Publish shared v2 packages #6

Workflow file for this run

name: Site
on:
workflow_dispatch:
push:
branches:
- master
- 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: Install Pro docs package
env:
CHART_KIT_PRO_NPM_TOKEN: ${{ secrets.CHART_KIT_PRO_NPM_TOKEN }}
run: |
if [ -z "$CHART_KIT_PRO_NPM_TOKEN" ]; then
echo "CHART_KIT_PRO_NPM_TOKEN is required to build Pro docs with @chart-kit/pro." >&2
exit 1
fi
npm config set //registry.npmjs.org/:_authToken "$CHART_KIT_PRO_NPM_TOKEN"
npm install --no-save --package-lock=false --ignore-scripts @chart-kit/pro
echo "CHART_KIT_PRO_DOCS=true" >> "$GITHUB_ENV"
- name: Build site
run: npm run site:build
- 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 }}