Extract build into reusable workflow to eliminate redundant clone+install+build across workflows#202
Open
Extract build into reusable workflow to eliminate redundant clone+install+build across workflows#202
Conversation
Agent-Logs-Url: https://github.com/ProLoser/PeaceInTheMiddleEast/sessions/d6c9baac-7a64-4a71-8bb3-944539894bdf Co-authored-by: ProLoser <67395+ProLoser@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Cache the build stage of the workflow for reusability
Extract build into reusable workflow to eliminate redundant clone+install+build across workflows
Mar 29, 2026
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.ymlandpreview.ymleach independently checked out, installed deps, and built — duplicating work on every PR and main push.Changes
New:
.github/workflows/build.ymlReusable
workflow_callworkflow encapsulating the full build pipeline. Uploadsdist/as a short-lived artifact consumed by downstream deploy jobs. Accepts an optionalbase-urlinput for preview sub-path builds.deploy.yml/preview.ymlbuildjob that callsbuild.ymldeployjob thatneeds: build, downloads the artifact, and deployspreview.ymlskips thebuildjob on PR close (if: github.event.action != 'closed') while thedeploy-previewcleanup job still runs viaif: always()Permissions hardening
Added explicit
permissionsblocks per job:contents: readfor build,contents: writefor gh-pages pushes,pull-requests: writefor PR preview comments,permissions: {}onworkflow_callcaller jobs.Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.