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.
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
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.
A broken browser does not hide the result of the other two: every run finishes and can be compared.
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
ui-tests:
name: UI tests (${{ matrix.browser }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
browser: [chromium, firefox, webkit]
What went wrong along the way
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.
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 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.
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.