Skip to content

Commit

Permalink
Add image expiration for branches
Browse files Browse the repository at this point in the history
  • Loading branch information
hluk committed Feb 19, 2024
1 parent 131cae0 commit 8127c46
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/workflows/resultsdb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ jobs:
containerfiles: Dockerfile
build-args: |
GITHUB_SHA=${{ github.sha }}
EXPIRES_AFTER=${{ github.ref == 'refs/heads/develop' && 'never' || '30d' }}
- name: Log in to the image registry
if: github.event_name == 'push' && github.actor != 'dependabot[bot]'
Expand Down
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ RUN sed -i 's#^WSGISocketPrefix .*#WSGISocketPrefix /tmp/wsgi#' conf/resultsdb.c
# --- Final image
FROM scratch
ARG GITHUB_SHA
ARG EXPIRES_AFTER
LABEL \
name="ResultsDB application" \
vendor="ResultsDB developers" \
Expand All @@ -82,7 +83,8 @@ LABEL \
url="https://github.com/release-engineering/resultsdb" \
vcs-type="git" \
vcs-ref=$GITHUB_SHA \
io.k8s.display-name="ResultsDB"
io.k8s.display-name="ResultsDB" \
quay.expires-after=$EXPIRES_AFTER

ENV \
PYTHONFAULTHANDLER=1 \
Expand Down

0 comments on commit 8127c46

Please sign in to comment.