Skip to content

Commit 6e4ccfd

Browse files
committed
Update docs deployment action to remove old nightly or main builds if a new one is pushed
1 parent 2014a8d commit 6e4ccfd

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

.detect-secrets.scan.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,5 +139,5 @@
139139
}
140140
]
141141
},
142-
"generated_at": "2026-05-29T02:48:07Z"
142+
"generated_at": "2026-05-29T03:01:36Z"
143143
}

.github/actions/project/docs/action.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,16 @@ runs:
135135
echo "[INFO] Setting default version to latest..."
136136
hatch run mike set-default -F zensical.toml --push latest
137137
fi
138+
if [ "$BUILD_TYPE" = "main" ] || [ "$BUILD_TYPE" = "nightly" ]; then
139+
echo "[INFO] Cleaning up older versions of type: $BUILD_TYPE..."
140+
TO_DELETE=$(hatch run mike list -F zensical.toml | awk '{print $1}' | grep "^${BUILD_TYPE}-" | grep -v "^${VERSION_NAME}$" || true)
141+
if [ -n "$TO_DELETE" ]; then
142+
echo "[INFO] Deleting old versions: $TO_DELETE"
143+
hatch run mike delete -F zensical.toml --push $TO_DELETE
144+
else
145+
echo "[INFO] No old versions of type $BUILD_TYPE found to delete."
146+
fi
147+
fi
138148
- name: Compute documentation URL
139149
id: url-step
140150
if: steps.check.outputs.run == 'true'

0 commit comments

Comments
 (0)