ci: one deploy job instead of two, so the work rounds once not twice - #4
Open
h0bnobs wants to merge 1 commit into
Open
ci: one deploy job instead of two, so the work rounds once not twice#4h0bnobs wants to merge 1 commit into
h0bnobs wants to merge 1 commit into
Conversation
GitHub bills every job rounded up to a whole minute. deploy_api averaged 1.6 minutes and deploy_frontend 1.8, so a push to main paid 4 billed minutes for 3.4 minutes of work. Across the estate that per-job rounding was 37% of the 30-day Actions bill: 1070 minutes of real work billed as 1708. Merging them keeps the work identical and pays one rounding and one checkout instead of two. Roughly 118 minutes a month back on honeycomb's volume alone. The API half runs first and its smoke test now gates the SWA upload, because sequential execution means the order decides which half-deployed state is reachable: a new API serving an old frontend is survivable, a new frontend calling an API without its endpoints is the outage. Both halves stay independently switchable. The job-level 'if' moved onto every step, so stinger's deploy_api: false keeps skipping the API half exactly as it did. The 31-input caller contract is unchanged and no step was added or lost. Costs wall-clock: a deploy takes ~3.4 min rather than ~1.8, since the halves no longer overlap. timeout-minutes raised 15 -> 25 to cover both end to end. Verified: actionlint clean, input contract diffs identical, step list identical.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
deploy_apianddeploy_frontendbecome a singledeployjob. Same steps, same inputs, one rounding.Why
GitHub bills each job rounded up to a whole minute. Measured over the last 30 days across honeycomb, forager, nasonov and claude-project-setup:
921 of those jobs ran in under 60 seconds and each was charged a full minute. These two deploy jobs are a clean instance: 1.6 min and 1.8 min, so 4 billed minutes for 3.4 minutes of work, on every push to main. Merged that is 4 billed minutes instead of 5, plus one checkout instead of two. Roughly 118 minutes a month on honeycomb's push volume, and it scales with each app that adopts the pipeline.
Caching was the obvious first idea and it is not the lever. Dependency install is 44 min a month across the whole estate and apt is 12, so under 6% combined, and pip and npm are already cached in
gate.API first, deliberately
Sequential execution means the order decides which half-deployed state a failure can leave. A new API serving an old frontend is survivable, because the frontend calls endpoints that still exist. A new frontend calling an API that has not got its new endpoints is the outage. So the API deploys and passes its smoke test before the SWA upload starts, and that smoke test now gates the frontend as well.
What is unchanged
gateis untouched.ifmoved onto every step, so stinger'sdeploy_api: falseskips the API steps exactly as before. Callers checked: honeycomb uses both halves on defaults, stinger uses the SWA half only.What this costs
Wall-clock. A deploy takes about 3.4 minutes rather than about 1.8, because the halves no longer overlap. That is the trade.
timeout-minutesgoes 15 to 25 to cover both end to end, since the API smoke test can legitimately spend 5 minutes waiting for a cold Consumption worker.Verification
actionlintclean, and confirmed non-vacuous by seeding a bad input reference and watching it fail.gateidentical, every step after checkout carries anifguard.🤖 Generated with Claude Code
https://claude.ai/code/session_011iqk1x2Tg1m4ZCwEVmVEz1