Skip to content

Commit a100b7e

Browse files
authored
Merge pull request #34215 from def-/pr-tag-multiarch
ci: Tag multiarch images on GHCR too
2 parents 7171610 + ba8b612 commit a100b7e

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

misc/python/materialize/mzbuild.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1471,6 +1471,31 @@ def publish_multiarch_images(
14711471
]
14721472
)
14731473
spawn.runv(["docker", "manifest", "push", name])
1474+
1475+
if token := os.getenv("GITHUB_GHCR_TOKEN"):
1476+
spawn.runv(
1477+
[
1478+
"docker",
1479+
"login",
1480+
"ghcr.io",
1481+
"-u",
1482+
"materialize-bot",
1483+
"--password-stdin",
1484+
],
1485+
stdin=token.encode(),
1486+
)
1487+
ghcr_prefix = "ghcr.io/materializeinc"
1488+
ghcr_name = f"{ghcr_prefix}/{name}"
1489+
spawn.runv(
1490+
[
1491+
"docker",
1492+
"manifest",
1493+
"create",
1494+
ghcr_name,
1495+
*(f"{ghcr_prefix}/{image.spec()}" for image in images),
1496+
]
1497+
)
1498+
spawn.runv(["docker", "manifest", "push", ghcr_name])
14741499
print(f"--- Nofifying for tag {tag}")
14751500
markdown = f"""Pushed images with Docker tag `{tag}`"""
14761501
spawn.runv(

0 commit comments

Comments
 (0)