A green production deployment is not proof of a healthy delivery system. A website can remain online while its recovery pipeline quietly stops working. That distinction became the central lesson of a recent investigation into CI/CD usage across a portfolio of web applications.
The goal was not to buy larger machines or move every workload to another provider. It was to reduce unnecessary work, protect essential operations and establish evidence for the next infrastructure decision. The investigation covered GitHub Actions, Vercel and static-site builds with Astro. Project names, domains, repository identifiers, exact incident dates and sensitive recovery details are intentionally omitted. Operational figures are rounded where appropriate.
1. Find the waste before buying capacity
I started by inventorying workflow runs, conclusions, triggers and deployment targets, rather than treating every failed run as a billable build. In one representative workload, roughly 500 CI runs were recorded over a 30-day period, with more than 60% ending in failure. Around 45% of the most recent deployment sample consisted of previews.
Those counts are signals, not a cost calculation. A job rejected before runner allocation may consume no execution minutes, while a single long-running browser test can use more compute than many short jobs. The correct next step is to connect run counts to billable duration, runner type, cache behavior, storage and actual hosting usage.
The more important finding was a shared-resource dependency: routine automation and recovery operations competed for the same CI capacity. Backup runs had failed repeatedly. A recent attempt ended before any job steps ran, which was consistent with an admission or quota problem, but the missing logs prevented a definitive root-cause diagnosis for that specific attempt.
2. Reduce work without weakening release gates
The changes targeted work with little incremental value rather than removing tests indiscriminately.
| Area | Optimization | Guardrail |
|---|---|---|
| Preview deployments | Make automatic previews opt-in for selected branches | Keep normal production deployments |
| Documentation changes | Skip expensive site compilation where appropriate | Retain source checks and build for code or configuration changes |
| Scheduled social checks | Consolidate four daily checks into one | Retain manual execution and pre-release checks |
| Browser testing | Avoid redundant broad suites on every change | Preserve required coverage on the production path |
| Static builds | Reuse a single build artifact across tests and deployment | Do not deploy an unvalidated artifact |
Reducing a four-times-daily schedule to one execution per day cuts that workflow’s scheduled run count by 75%. It does not imply a 75% reduction in the account’s total bill. Some checks can be consolidated safely, while others must remain independent because they protect distinct failure modes.
One additional lesson: a configuration change that disables previews can interact with required deployment status checks. Review branch protection before rolling out an opt-in policy. A skipped or missing check must not accidentally block ordinary pull requests or permit untested releases.
3. Measure build memory, not just the Node.js heap
A large Astro site had historically used a generous Node.js heap on a CI runner and deployed prebuilt output to its hosting provider. Image transformations were a suspected source of memory pressure. Rather than immediately change the build platform, I ran two controlled experiments using a smaller heap and reduced allocator and thread-pool settings.
| Experiment | Warm asset cache | Cold asset cache |
|---|---|---|
| Node.js heap limit | 4.5 GiB | 4.5 GiB |
| Build duration | About 1m 45s | About 2m 37s |
| Peak RSS reported by GNU time | About 3.2 GiB | About 3.0 GiB |
| Sampled aggregate process-tree RSS | Not measured | About 3.1 GiB |
| Build and browser tests | Passed | Passed |
For comparison, the original heap limit was 12 GiB. Reducing that limit to 4.5 GiB is a 62.5% reduction in the configured heap ceiling, not a measured 62.5% reduction in real memory use. The cold run explicitly skipped restoration of the Astro asset cache and produced no reused image-cache entries.
How to reproduce the experiment
The following is a generic Linux example for a compatible pnpm-based Astro project. Run it in a disposable checkout, not against an active production build.
pnpm install --frozen-lockfile
rm -rf node_modules/.astro
export NODE_OPTIONS=--max-old-space-size=4608
export UV_THREADPOOL_SIZE=2
export MALLOC_ARENA_MAX=2
/usr/bin/time -v pnpm buildThe actual experiment additionally sampled the resident memory of the build process and its descendants every half-second. This matters because Node.js heap usage alone does not account for native image libraries, subprocesses or allocator overhead.
GNU time’s maximum RSS is not a measurement of total simultaneous process memory. Summed RSS can double-count shared pages, and periodic sampling can miss short-lived spikes. Where available, a dedicated cgroup or container memory peak provides another useful measurement.
These results support testing a standard-memory build environment. They do not prove that an entire installation, build and packaging sequence will fit on a particular hosting machine. The production deployment architecture was not changed on the strength of this experiment alone.
4. Treat recovery capacity as a reliability requirement
The most consequential observation was not the number of builds. It was the absence of a recent confirmed successful backup for an extended period. A healthy database service is not evidence of recoverability.
The investigation identified the last recorded successful upload and added diagnostics for database connectivity, permissions, archive structure and private storage access. At the time of writing, the presence and restorability of the historical artifact had not been independently verified.
A recovery workflow should distinguish four separate states:
- Captured: a database dump was created successfully.
- Stored: the archive and its manifest were uploaded to private storage.
- Verified: the stored bytes match the expected size and cryptographic checksum.
- Restored: the data was successfully loaded and checked in an isolated environment.
A checksum can detect corruption; it cannot establish that the dump contains every required schema, role, external object or application dependency. An archive listing is useful, but an actual restore test is the stronger proof.
Retention deserves the same scrutiny. An age-based deletion rule should never remove the last known usable recovery point simply because a new job reports success. Preserve known-good copies, verify replacements and make deletion fail closed when inventory or retention configuration is uncertain. Test deletion policy with synthetic objects before enabling it against live storage.
These are recovery requirements, not claims that recovery has already succeeded. No credentials, database contents, object paths or live recovery identifiers are published here.
5. Measure outcomes after the changes
FinOps is a feedback loop. To compare the baseline and the optimized system, I would track:
- Billable CI minutes by repository, workflow and runner type.
- Failure rate, separating runner-admission failures from failures during execution.
- Production and preview deployments, build duration and cache-hit rates.
- Backup age, verified recovery points and the results of restore exercises.
- Actual platform charges, normalized for changes in publishing frequency and workload.
The workflow reductions and memory experiments are observable results. Account-wide financial savings, complete recovery readiness and a hosting migration remain unverified. No additional paid capacity was activated during this investigation.
The takeaway
The cheapest build is often the one you do not need to run. But the most valuable CI job may be the one that protects your ability to recover, even when nothing visibly changes on the website.
Optimize the work before moving it between platforms. Preserve essential checks. Measure memory with both warm and cold caches. Keep recovery evidence separate from deployment success. And never describe a cost saving or a successful restore that has not actually been measured.
