Skip to content

Deploy cloudflare

Deploy cloudflare #9

Workflow file for this run

name: Deploy cloudflare
on:
workflow_run:
workflows: ["Lint"]
branches: [main]
types:
- completed
jobs:
deploy:
runs-on: ubuntu-latest
if: "${{ github.event.workflow_run.conclusion == 'success' }}"
steps:
- uses: actions/checkout@v4
- uses: "actions/setup-node@v4"
with:
node-version-file: ".nvmrc"
- uses: "pnpm/action-setup@v3"
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v4
name: Setup pnpm cache
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 install --frozen-lockfile"
- name: Build & Deploy Worker
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
run: "pnpm run deploy"