Skip to content

Commit

Permalink
add tag id's to each latest container push
Browse files Browse the repository at this point in the history
Signed-off-by: szaimen <[email protected]>
  • Loading branch information
szaimen committed May 12, 2022
1 parent c9449c2 commit dfaaaf6
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/promote-single-container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ jobs:
run: |
AIO_NAME=${{ github.event.inputs.imageName }}
TARGET_TAG=${{ github.event.inputs.targetTag }}
DATE="$(date +"%Y%m%d_%H%M%S")"
if [ "$TARGET_TAG" != beta ] && [ "$TARGET_TAG" != latest ]; then
echo "only beta and latest are supported as tags"
exit 1
Expand All @@ -37,10 +38,18 @@ jobs:
# x64
docker pull nextcloud/$AIO_NAME\:"$SOURCE_TAG"
docker tag nextcloud/$AIO_NAME\:"$SOURCE_TAG" nextcloud/$AIO_NAME\:"$TARGET_TAG"
if [ "$AIO_NAME" != "all-in-one" ] && [ "$TARGET_TAG" = latest ]; then
docker tag nextcloud/$AIO_NAME\:"$SOURCE_TAG" nextcloud/$AIO_NAME\:"$DATE"-"$TARGET_TAG"
docker push nextcloud/$AIO_NAME\:"$DATE"-"$TARGET_TAG"
fi
docker push nextcloud/$AIO_NAME\:"$TARGET_TAG"
if [ "$AIO_NAME" != "aio-clamav" ] && [ "$AIO_NAME" != "aio-onlyoffice" ]; then
# arm64
docker pull nextcloud/$AIO_NAME\:"$SOURCE_TAG"-arm64
docker tag nextcloud/$AIO_NAME\:"$SOURCE_TAG"-arm64 nextcloud/$AIO_NAME\:"$TARGET_TAG"-arm64
docker push nextcloud/$AIO_NAME\:"$TARGET_TAG"-arm64
if [ "$AIO_NAME" != "all-in-one" ] && [ "$TARGET_TAG" = latest ]; then
docker tag nextcloud/$AIO_NAME\:"$SOURCE_TAG"-arm64 nextcloud/$AIO_NAME\:"$DATE"-"$TARGET_TAG"-arm64
docker push nextcloud/$AIO_NAME\:"$DATE"-"$TARGET_TAG"-arm64
fi
fi
9 changes: 9 additions & 0 deletions .github/workflows/promote-to-latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,23 @@ jobs:
run: |
set -x
AIO_NAME=${{ matrix.name }}
DATE="$(date +"%Y%m%d_%H%M%S")"
set +x
# x64
docker pull nextcloud/$AIO_NAME\:beta
docker tag nextcloud/$AIO_NAME\:beta nextcloud/$AIO_NAME\:latest
docker push nextcloud/$AIO_NAME\:latest
if [ "$AIO_NAME" != "all-in-one" ]; then
docker tag nextcloud/$AIO_NAME\:beta nextcloud/$AIO_NAME\:"$DATE"-latest
docker push nextcloud/$AIO_NAME\:"$DATE"-latest
fi
if [ "$AIO_NAME" != "aio-clamav" ] && [ "$AIO_NAME" != "aio-onlyoffice" ]; then
# arm64
docker pull nextcloud/$AIO_NAME\:beta-arm64
docker tag nextcloud/$AIO_NAME\:beta-arm64 nextcloud/$AIO_NAME\:latest-arm64
docker push nextcloud/$AIO_NAME\:latest-arm64
if [ "$AIO_NAME" != "all-in-one" ]; then
docker tag nextcloud/$AIO_NAME\:beta-arm64 nextcloud/$AIO_NAME\:"$DATE"-latest-arm64
docker push nextcloud/$AIO_NAME\:"$DATE"-latest-arm64
fi
fi

0 comments on commit dfaaaf6

Please sign in to comment.