✏️ Latest writings

Long form blogs, essays, musings.

7 MAY 2025

Tech I'm Interested in 2025

7 JAN 2024

I Hiked To Everest Basecamp

27 MAY 2023

Easy React data fetching with `use()`

12 JUN 2022

Create an auto-generated JS client for any REST API

26 DEC 2021

Eco-friendly websites
View all blogs ➡︎

🗒️ Latest note

Latest rambling posted on 1 June 2025

Creating a GitHub action with an on action of workflow_dispatch lets you create a webhook to run anything essentially.

for example, if I have a GitHub action called deploy.yml my GitHub repo called my-code I can execute this webhook with the following curl:

curl -X POST \
  https://api.github.com/repos/my-code/your-repo/actions/workflows/deploy.yml/dispatches \
  -H "Authorization: token YOUR_GITHUB_PAT" \
  -H "Accept: application/vnd.github.v3+json" \
  -H "Content-Type: application/json" \
  -d '{"ref":"main"}'

For some reason Cloudflare workers dont have deploy webhook like Cloudflare pages out the box, so this solution works as a pretty good alternative, heres the action that redeploys my website:

# deploy-chiubaca-com.yml
name: Redeploy chiubaca.com to Cloudflare worker
on:
  workflow_dispatch:
jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: pnpm/action-setup@v2
        with:
          version: 8
      - name: Install dependencies
        run: pnpm install
      - name: Build chiubaca.com
        run: pnpm -w run chiubaca.com:build
      - name: Publish to Cloudflare
        run: pnpm -w run chiubaca.com:deploy
        env:
          CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}

Like in the above example, i can execute this action just by running:

curl -X POST \
            https://api.github.com/repos/chiubaca/chiubaca-monorepo/actions/workflows/deploy-chiubaca-com.yml/dispatches \
            -H "Authorization: token ${{secrets.GHUB_PAT_FOR_CHIUBACA_COM_REDEPLOY_ACTION}}" \
            -H "Accept: application/vnd.github.v3+json" \
            -H "Content-Type: application/json" \
            -d '{"ref":"main"}'