Skip to content

Commit 401b7bd

Browse files
committed
Support prime only releases
Signed-off-by: Derek Nola <derek.nola@suse.com>
1 parent bea93c3 commit 401b7bd

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

.github/workflows/release.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,16 @@ jobs:
402402
mv ./bin/binaries-arm64 ./rootfs/bin/arm64
403403
chmod +x ./rootfs/bin/amd64/* ./rootfs/bin/arm64/*
404404
405+
# if the release is suffixed with -primeXX, do not publish to DockerHub
406+
- name: Check release suffix
407+
id: release_suffix
408+
run: |
409+
if [[ "${GITHUB_REF_NAME}" == *"-prime"* ]]; then
410+
echo "RELEASE_SUFFIX=prime" >> $GITHUB_ENV
411+
else
412+
echo "RELEASE_SUFFIX=community" >> $GITHUB_ENV
413+
fi
414+
405415
# Only pull vault secrets if the repository is rancher
406416
- name: "Read secrets"
407417
if: github.repository_owner == 'rancher'
@@ -413,8 +423,9 @@ jobs:
413423
secret/data/github/repo/${{ github.repository }}/rancher-prime-registry/credentials registry | PRIME_REGISTRY ;
414424
secret/data/github/repo/${{ github.repository }}/rancher-prime-registry/credentials username | PRIME_REGISTRY_USERNAME ;
415425
secret/data/github/repo/${{ github.repository }}/rancher-prime-registry/credentials password | PRIME_REGISTRY_PASSWORD
426+
416427
- name: Login to Container Registry with Rancher Secrets
417-
if: github.repository_owner == 'rancher'
428+
if: github.repository_owner == 'rancher' && env.RELEASE_SUFFIX == 'community'
418429
uses: docker/login-action@v3
419430
with:
420431
username: ${{ env.DOCKER_USERNAME }}
@@ -460,6 +471,7 @@ jobs:
460471
public-repo: ${{ env.REGISTRY }}
461472
public-username: ${{ env.DOCKER_USERNAME }}
462473
public-password: ${{ env.DOCKER_TOKEN }}
474+
push-to-public: ${{ github.repository_owner != 'rancher' || env.RELEASE_SUFFIX == 'community' }}
463475

464476
prime-repo: rancher
465477
prime-registry: ${{ env.PRIME_REGISTRY }}
@@ -476,6 +488,7 @@ jobs:
476488
public-repo: ${{ env.REGISTRY }}
477489
public-username: ${{ env.DOCKER_USERNAME }}
478490
public-password: ${{ env.DOCKER_TOKEN }}
491+
push-to-public: ${{ github.repository_owner != 'rancher' || env.RELEASE_SUFFIX == 'community' }}
479492

480493
prime-repo: rancher
481494
prime-registry: ${{ env.PRIME_REGISTRY }}

0 commit comments

Comments
 (0)