~/VibeHandbook
$39

Chapter 13 · 05

How AI wires up deploys and config

This is where vibe coding shines. Deployment config is exactly the kind of precise, well-documented, boilerplate-heavy work AI is great at. You direct; it writes.

Effective prompts sound like:

  • "Add a Dockerfile for this Node app and a Railway config to it."
  • "Write a GitHub Actions workflow that deploys the dist/ folder to Cloudflare Pages on every push to main."
  • "I'm getting a cold-start timeout on my function — what's likely wrong and how do I fix the config?"

Here's the kind of file AI will produce for you — a deploy workflow that ships a static site automatically whenever you push code:

# .github/workflows/deploy.yml
name: Deploy
on:
  push:
    branches: [main]
jobs:
  build-and-deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: 20
      - run: npm ci && npm run build
      - name: Publish to Cloudflare Pages
        uses: cloudflare/wrangler-action@v3
        with:
          apiToken: ${{ secrets.CF_API_TOKEN }}
          command: pages deploy dist --project-name=my-app

You don't need to memorize this syntax. You need to recognize what it does: on every push to main, it checks out your code, builds it, and publishes the result. When something breaks, you paste the error back to the AI and ask it to fix the config.

Many builders skip the GitHub Actions file entirely at first and just deploy from their own with one command. That's often the fastest way to see something live on day one. The same Cloudflare Pages deploy looks like this from the command line:

# install the CLI once
npm install -g wrangler

# build your site, then push the output folder live
npm run build
wrangler pages deploy dist --project-name=my-app

The first run will ask you to log in through your browser; after that it's a single command. The trade-off is simple: the terminal command is great for "ship it now," and the GitHub Actions file is great for "ship it automatically forever." Most projects start with the former and add the latter once deploys become routine. Ask AI for whichever fits where you are.

A few directing tips that save real pain:

  • Make AI explain before it acts. "Before writing config, tell me which hosting type fits this project and why." This catches over-engineering early.
  • Keep secrets out of code. keys and passwords go in the platform's environment variables / secrets store, never in files you . Ask AI to use a secrets reference, as in the CF_API_TOKEN above.
  • Deploy early, deploy often. Get a "hello world" live on day one. A pipeline that's been working since the start is far easier to debug than one assembled at launch.
  • Ask for the rollback story up front. "If this deploy is broken, how do I get back to the working version?" Good platforms keep your previous deploys one click away. Knowing the undo button exists before you need it turns a 2 a.m. panic into a shrug.

Want it offline?

Get the PDF + EPUB + downloadable prompt library + version updates.

$ Get the PDF — $39