portfolio / projects / ci-cd
andresqe.duckdns.org · HTTPS · up
Case study · CI/CD ● CI passing

CI/CD with GitHub Actions: the same Docker image on my machine and in the pipeline

A workflow with 4 parallel jobs (API, and UI on Chromium, Firefox and WebKit) that runs inside the official Playwright image, with layer caching, reports as artifacts and an explicit rule for what is out of my hands.

Role
Sole author
Stack
GitHub Actions · Docker · Allure
Triggers
push and pull request to master, and manual

The problem

The classic "it works on my machine": installing Python and the browsers by hand on the runner gives an environment different from the local one, with versions drifting apart and failures nobody can reproduce.

The approach

A single image (the official Playwright one for Python, with its version pinned) is built once and used the same way locally and in CI: the pipeline only builds and runs docker run. Allure reports and, when something fails, Playwright traces are uploaded as artifacts.

Key decisions

01 One image, two uses

Playwright and the base image always change together and to the same exact version: otherwise the image's browser stops being compatible with the library and will not start.

02 A 3-browser matrix without fail-fast

A broken browser does not hide the result of the other two: every run finishes and can be compared.

03 External issues do not block, but are not hidden

The booking flow depended on a practice site that failed repeatedly only from GitHub runners, so it runs with continue-on-error: it stays in the log and in the artifacts, but does not dirty the badge.

How it runs

git push / PR→ docker build (layer cache)→ API · UI × 3 browsers→ Allure + traces as artifacts→ this site's badge
  ui-tests:
    name: UI tests (${{ matrix.browser }})
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        browser: [chromium, firefox, webkit]

Real header of the UI job in .github/workflows/tests.yml.

Jobs per run41 API + 3 UI, in parallel
Browsers3Chromium · Firefox · WebKit
Run duration6-11 minlast 8 runs read from GitHub on 2026-10-10

What went wrong along the way

Playwright version vs. image

requirements.txt accepted any recent version while the image was pinned to an older one: Playwright refused to launch the browser. The exact version was pinned, and the image tag changes with it.

Two Allure plugins that cannot coexist

allure-pytest and allure-pytest-bdd register the same option and pytest blows up when both load (a known ecosystem incompatibility, not a mistake of mine). Both are disabled by default and one is enabled at a time.

The booking flow only fails in CI

The same test passes locally and was failing from GitHub runners; the most likely cause is the practice site throttling datacenter IPs (unconfirmed). In recent runs it passed.

Real history (read from the GitHub API on 2026-10-10): of the 13 pushes to master in the list, 6 failed during development and the 5 most recent passed.

The same pattern on this site

The site you are reading has its own pipeline: tests (including a pass against a real PostgreSQL) run before every deploy and, if they fail, nothing is published; after deploying, a smoke test and a security-header check look at the real response. On a pull request it only tests, it never deploys. This was checked with a test PR containing a deliberately broken test: Tests red and Deploy skipped.

View deploy.yml →

Limits

  • This repository is CI: it deploys nothing. The real continuous deployment lives in the site's repository (block above).
  • The pipeline depends on an external practice site; the booking flow is still the fragile part.
  • Durations come from GitHub timestamps and include queue time: they are approximate.