Skip to content

Commit 459ddac

Browse files
chore(ci): always build tutorial agents with --no-cache
Force --no-cache on every build in the publish workflow (both the ':latest' push path and SHA-tagged validation builds), not just the mutable-tag path. Simpler and removes any chance of a stale cached layer shipping outdated source; costs only a few minutes of build time. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 5932d9c commit 459ddac

1 file changed

Lines changed: 4 additions & 7 deletions

File tree

.github/workflows/build-and-push-tutorial-agent.yml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -185,24 +185,21 @@ jobs:
185185
if [ "${{ github.event_name }}" = "push" ] || [ "${{ inputs.rebuild_all }}" = "true" ]; then
186186
SHOULD_PUSH=true
187187
VERSION_TAG="latest"
188-
# ':latest' is a moving tag, so build without cache: a stale cached layer
189-
# must never silently ship source that differs from the checkout.
190-
CACHE_FLAG="--no-cache"
191188
echo "🚀 Building agent (will push after validation): ${{ matrix.agent_path }}"
192189
else
193190
SHOULD_PUSH=false
194191
VERSION_TAG="${{ github.sha }}"
195-
# SHA-tagged validation build is immutable, so the cache is safe (and faster).
196-
CACHE_FLAG="--cache"
197192
echo "🔍 Building agent for validation: ${{ matrix.agent_path }}"
198193
# Set full image name for validation step (local build)
199194
echo "FULL_IMAGE=${REGISTRY}/${REPOSITORY_NAME}:${VERSION_TAG}" >> $GITHUB_ENV
200195
# Skip image validation for PRs since Buildx doesn't load multi-platform images locally
201196
echo "SKIP_VALIDATION=true" >> $GITHUB_ENV
202197
fi
203198
204-
# Always build locally first (without push)
205-
BUILD_ARGS="--manifest ${{ matrix.agent_path }}/manifest.yaml --registry ${REGISTRY} --tag ${VERSION_TAG} --platforms linux/amd64,linux/arm64 --repository-name ${REPOSITORY_NAME} ${CACHE_FLAG}"
199+
# Always build without cache: a stale cached layer must never silently ship
200+
# source that differs from the checkout (this is how a merged fix once failed
201+
# to reach ':latest'). Correctness over a few minutes of build time.
202+
BUILD_ARGS="--manifest ${{ matrix.agent_path }}/manifest.yaml --registry ${REGISTRY} --tag ${VERSION_TAG} --platforms linux/amd64,linux/arm64 --repository-name ${REPOSITORY_NAME} --no-cache"
206203
207204
agentex agents build $BUILD_ARGS
208205
echo "✅ Successfully built: ${REGISTRY}/${REPOSITORY_NAME}:${VERSION_TAG}"

0 commit comments

Comments
 (0)