Skip to content

update CI workflow to install non-production dependencies and verify … #23

update CI workflow to install non-production dependencies and verify …

update CI workflow to install non-production dependencies and verify … #23

name: Deploy to Cloudflare Pages
on:
push:
branches:
- main
- master
pull_request:
branches:
- main
- master
jobs:
deploy:
runs-on: ubuntu-latest
name: Deploy to Cloudflare Pages
permissions:
contents: read
deployments: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9.15.9
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- name: Setup pnpm cache
uses: actions/cache@v4
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm -r install --frozen-lockfile --prod=false
- name: Verify build tooling
run: pnpm --filter @cazala/party exec -- rollup --version
- name: Build
run: pnpm --filter=@cazala/party build && pnpm --filter=@cazala/playground build
- name: Install Wrangler
run: npm install -g wrangler@3
- name: Create Cloudflare Pages project if it doesn't exist
run: |
# Set up wrangler authentication
export CLOUDFLARE_API_TOKEN="${{ secrets.CLOUDFLARE_API_TOKEN }}"
export CLOUDFLARE_ACCOUNT_ID="${{ secrets.CLOUDFLARE_ACCOUNT_ID }}"
# Check if project exists, create if it doesn't
if ! wrangler pages project list 2>/dev/null | grep -q "party"; then
echo "Creating Cloudflare Pages project 'party'..."
wrangler pages project create party --production-branch=main || true
else
echo "Project 'party' already exists"
fi
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
- name: Deploy to Cloudflare Pages
uses: cloudflare/pages-action@v1
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName: party
directory: packages/playground/dist
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
wranglerVersion: '3'