Skip to content
Latchkey

CI/CD for a Qwik City App with GitHub Actions

Lint, type-check, test, and build your Qwik City app for the edge on every push.

Qwik City ships resumable apps with adapters for various edge hosts. This recipe lints and type-checks the app, runs tests, and builds the SSR output via the configured adapter so the deploy artifact is ready.

What the pipeline does

  • install deps with npm ci
  • lint with eslint
  • type-check with tsc
  • run tests with vitest
  • build the SSR adapter output

The workflow

npm run build runs the Qwik client and SSR builds through the adapter. The adapter output (e.g., a Cloudflare or Node server) is the deploy artifact.

.github/workflows/ci.yml
name: CI
on:
  push:
    branches: [main]
  pull_request:
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: 20
          cache: npm
      - run: npm ci
      - run: npm run lint
      - run: npx tsc --noEmit
      - run: npm test
      - run: npm run build
      - uses: actions/upload-artifact@v4
        with:
          name: qwik-dist
          path: dist

Caching and speed

cache: npm restores node_modules between runs. The dual client+SSR build is CPU bound; cheaper managed runners such as Latchkey (around 69% cheaper than GitHub-hosted) keep PR builds fast and auto-retry a flaky install.

Deploying

Pick the Qwik adapter that matches your host: @builder.io/qwik-city/adapters/cloudflare-pages for Pages, or the node-server adapter for a container. Add a deploy job that ships the built server using that host's CLI once tests pass on main.

Key takeaways

  • Type-check with tsc --noEmit so resumability boundaries stay sound.
  • Build through the adapter that matches your target host.
  • Upload the dist/ artifact so the deploy job ships exactly what was tested.

Related guides

Run this faster and cheaper on Latchkey managed runners. Start free →