Skip to content

Commit 4bb780f

Browse files
committed
Add nightly job for updating latest and stable tags
Signed-off-by: Samuel Monson <[email protected]>
1 parent e360711 commit 4bb780f

File tree

3 files changed

+32
-2
lines changed

3 files changed

+32
-2
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Container Image Maintenance
2+
3+
on:
4+
schedule:
5+
- cron: '0 2 * * 3' # Runs at 2am on Wednesdays
6+
workflow_dispatch: # Enables manual triggering of the workflow
7+
8+
jobs:
9+
push-container-tags:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Log into ghcr.io
13+
uses: redhat-actions/podman-login@v1
14+
with:
15+
username: ${{ github.actor }}
16+
password: ${{ github.token }}
17+
registry: ghcr.io/${{ github.repository_owner }}
18+
- name: Get list of tags
19+
run: |
20+
skopeo list-tags docker://${{ github.repository }} | jq --raw-output '.Tags[]' > tags
21+
- name: Get latest release and rc tags
22+
run: |
23+
STABLE_TAG="$(grep -P '^v\d+\.\d+\.\d+$' tags | sort -rV | head -n1)"
24+
echo "STABLE_TAG=${STABLE_TAG:-v0.0.0}" >> $GITHUB_ENV
25+
LATEST_TAG="$(grep -P '^v\d+\.\d+\.\d+' tags | sort -rV | head -n1)"
26+
echo "LATEST_TAG=${LATEST_TAG:-v0.0.0}" >> $GITHUB_ENV
27+
- name: Update latest and stable tags
28+
run: |
29+
skopeo copy docker://${{ github.repository }}:${{ env.stable_tag }} docker://${{ github.repository }}:stable
30+
skopeo copy docker://${{ github.repository }}:${{ env.latest_tag }} docker://${{ github.repository }}:latest

.github/workflows/release-candidate.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ jobs:
306306
image: ${{ github.event.repository.name }}
307307
build-args: |
308308
GUIDELLM_BUILD_TYPE=candidate
309-
tags: latest ${{ env.package_version }}-rc
309+
tags: ${{ env.package_version }}~rc
310310
containerfiles: |
311311
./Containerfile
312312
- name: Push To ghcr.io

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ jobs:
305305
image: ${{ github.event.repository.name }}
306306
build-args: |
307307
GUIDELLM_BUILD_TYPE=release
308-
tags: latest stable ${{ env.package_version }}
308+
tags: ${{ env.package_version }}
309309
containerfiles: |
310310
./Containerfile
311311
- name: Push To ghcr.io

0 commit comments

Comments
 (0)