Move to Cloudflare Pages #808
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: CI | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
permissions: | |
contents: read | |
deployments: write | |
jobs: | |
test: | |
name: Test | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
steps: | |
- name: Checkout the repository | |
uses: actions/checkout@v4 | |
- name: Install pnpm | |
uses: pnpm/action-setup@v4 | |
with: | |
version: 10 | |
- name: Install Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 23 | |
cache: pnpm | |
- name: Install dependencies | |
run: pnpm install --ignore-scripts | |
- name: Run tests | |
run: node --run test | |
deploy: | |
name: Deploy | |
runs-on: ubuntu-latest | |
if: github.ref == 'refs/heads/main' | |
needs: | |
- test | |
steps: | |
- name: Checkout the repository | |
uses: actions/checkout@v4 | |
- name: Install pnpm | |
uses: pnpm/action-setup@v4 | |
with: | |
version: 10 | |
- name: Install Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 23 | |
- name: Install dependencies | |
run: pnpm install --production --ignore-scripts | |
- name: Build OKLCH | |
run: node --run build | |
- name: Deploy OKLCH | |
id: deploy | |
uses: cloudflare/wrangler-action@v3 | |
with: | |
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
command: pages deploy dist/ --project-name=oklch | |
- name: Clean build dir | |
run: node --run clean | |
- name: Build LCH | |
run: node --run build:lch | |
- name: Deploy LCH | |
uses: cloudflare/wrangler-action@v3 | |
with: | |
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
command: pages deploy dist/ --project-name=lch |