ci(content-sync): optimise images automatically in CI - #77
Merged
Conversation
Contributor
|
🔍 Preview: https://website-1gfa8q6ab-ocobo-22231b32.vercel.app Built from website |
wab
force-pushed
the
ci/optimize-assets-in-ci
branch
from
June 19, 2026 15:42
5045cdd to
c3f5c08
Compare
Mirrors upload-assets' --base: scope re-encoding to assets changed between a base ref and HEAD, since the CI working tree is clean and --changed (working-tree diff) finds nothing there. Lets the optimizer and uploader see the same branch asset set.
Adds an Optimize step before upload so oversized images are re-encoded in CI regardless of how the PR was authored. The local /publish-content optimise step still runs first; this is the safety net that was missing when #73 shipped raw 2-3MB avatars straight to Blob. Optimised bytes are uploaded and committed back. Doc updated to match (was 'local-only').
wab
force-pushed
the
ci/optimize-assets-in-ci
branch
from
June 19, 2026 15:48
c3f5c08 to
6cd5d30
Compare
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.
Pourquoi
La PR #73 a poussé des avatars bruts (2–3 MB) directement sur Vercel Blob. Cause :
optimize-assetsn'existait à aucune étape de la CI — c'était une étape locale du flux/publish-content, contournable si le contributeur publie autrement. (Voir aussi la PR #76 qui répare les images déjà en prod.)Cette PR ajoute l'optimisation en CI pour qu'elle tienne quel que soit le chemin de publication, dans la même logique que le garde-fou
displayOrder(ne pas dépendre du jugement du contributeur).Changements
feat(optimize-assets): nouveau mode--base <ref>, miroir de celui d'upload-assets. Nécessaire car en CI l'arbre de travail est propre →--changed(diff working-tree) ne voit rien.--basescope sur les assets modifiés entre la base et HEAD. + tests (parse, resolveScope, resolveChangedPathsAgainstBase).ci(content-sync): step Optimize changed images ajouté avant l'upload Blob. Les octets optimisés sont donc ce qui part sur Blob, puis committé back sur la branche.docs/asset-management.mdcorrigé (disait « local-only — there is no CI step » — c'est maintenant faux).Ordre des étapes CI
L'étape locale
/publish-contentreste en place (évite d'uploader des octets lourds) ; la CI est le filet de sécurité.Checks
pnpm test✅ (181/181, +6 nouveaux)Note
Indépendante de #76 (fichiers disjoints). Aucune dépendance d'ordre de merge.