Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ jobs:
context: .
push: false
tags: document-categoriser:test
load: true
cache-from: type=gha
cache-to: type=gha,mode=max

Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/cleanup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ jobs:

echo "Listing images older than 30 days (keeping latest 10)..." >> $GITHUB_STEP_SUMMARY

# Get images older than 30 days, excluding latest 10
# Get all images, sort by date, exclude latest 10, then filter by date
THIRTY_DAYS_AGO=$(date -d '30 days ago' '+%Y-%m-%dT%H:%M:%S')
OLD_IMAGES=$(aws ecr describe-images \
--repository-name $REPOSITORY \
--query 'sort_by(imageDetails,&imagePushedAt)[:-10].imageDigest' \
--output text \
--filter "imageDetail.imagePushedAt < $(date -d '30 days ago' --iso-8601)")
--query "sort_by(imageDetails,&imagePushedAt)[:-10][?imagePushedAt<'$THIRTY_DAYS_AGO'].imageDigest" \
--output text)

if [[ -z "$OLD_IMAGES" ]]; then
echo "✅ No old images found for cleanup" >> $GITHUB_STEP_SUMMARY
Expand Down
1 change: 1 addition & 0 deletions src/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ def health_check():
return jsonify({
'status': 'healthy',
'service': 'document-categoriser',
'version': '1.0.0',
'timestamp': datetime.utcnow().isoformat()
}), 200

Expand Down
Loading