2023-10-28 16:08:53 +02:00
|
|
|
name: On release
|
|
|
|
|
|
|
|
on:
|
2023-11-08 14:22:23 +01:00
|
|
|
workflow_dispatch:
|
2023-10-28 16:08:53 +02:00
|
|
|
release:
|
|
|
|
types: [published]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
release:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v4
|
|
|
|
- id: lowercaseRepo
|
2023-11-02 14:36:49 +01:00
|
|
|
uses: ASzc/change-string-case-action@v6
|
2023-10-28 16:08:53 +02:00
|
|
|
with:
|
|
|
|
string: ${{ github.repository }}
|
|
|
|
- name: Log in to the Container registry
|
2024-10-01 14:03:55 +02:00
|
|
|
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567
|
2023-10-28 16:08:53 +02:00
|
|
|
with:
|
|
|
|
registry: ghcr.io
|
|
|
|
username: ${{ github.actor }}
|
|
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Create tag variables
|
|
|
|
run: |
|
2024-08-24 14:25:24 +02:00
|
|
|
BUILD_TYPE=$([[ "${{ github.ref_name }}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]] && echo "stable" || echo "beta")
|
|
|
|
echo "BUILD_TYPE=${BUILD_TYPE}" >> $GITHUB_ENV
|
2023-10-28 16:08:53 +02:00
|
|
|
echo "BASE=ghcr.io/${{ steps.lowercaseRepo.outputs.lowercase }}" >> $GITHUB_ENV
|
2024-08-24 14:25:24 +02:00
|
|
|
echo "BUILD_TAG=${GITHUB_SHA::7}" >> $GITHUB_ENV
|
2023-10-28 16:08:53 +02:00
|
|
|
echo "CLEAN_VERSION=$(echo ${GITHUB_REF##*/} | tr '[:upper:]' '[:lower:]' | sed 's/^[v]//')" >> $GITHUB_ENV
|
|
|
|
- name: Tag and push the main image
|
|
|
|
run: |
|
|
|
|
VERSION_TAG=${BASE}:${CLEAN_VERSION}
|
2024-06-01 14:39:05 +02:00
|
|
|
STABLE_TAG=${BASE}:stable
|
2023-10-28 16:08:53 +02:00
|
|
|
PULL_TAG=${BASE}:${BUILD_TAG}
|
2023-11-08 14:22:23 +01:00
|
|
|
docker run --rm -v $HOME/.docker/config.json:/config.json quay.io/skopeo/stable:latest copy --authfile /config.json --multi-arch all docker://${PULL_TAG} docker://${VERSION_TAG}
|
2023-11-10 02:02:16 +01:00
|
|
|
for variant in standard-arm64 tensorrt tensorrt-jp4 tensorrt-jp5 rk; do
|
2023-11-08 14:22:23 +01:00
|
|
|
docker run --rm -v $HOME/.docker/config.json:/config.json quay.io/skopeo/stable:latest copy --authfile /config.json --multi-arch all docker://${PULL_TAG}-${variant} docker://${VERSION_TAG}-${variant}
|
|
|
|
done
|
2024-06-01 14:39:05 +02:00
|
|
|
|
|
|
|
# stable tag
|
2024-08-24 14:25:24 +02:00
|
|
|
if [[ "${BUILD_TYPE}" == "stable" ]]; then
|
2024-06-01 14:39:05 +02:00
|
|
|
docker run --rm -v $HOME/.docker/config.json:/config.json quay.io/skopeo/stable:latest copy --authfile /config.json --multi-arch all docker://${PULL_TAG} docker://${STABLE_TAG}
|
|
|
|
for variant in standard-arm64 tensorrt tensorrt-jp4 tensorrt-jp5 rk; do
|
|
|
|
docker run --rm -v $HOME/.docker/config.json:/config.json quay.io/skopeo/stable:latest copy --authfile /config.json --multi-arch all docker://${PULL_TAG}-${variant} docker://${STABLE_TAG}-${variant}
|
|
|
|
done
|
|
|
|
fi
|