diff options
| author | Dax Raad <[email protected]> | 2026-01-29 23:07:58 -0500 |
|---|---|---|
| committer | Dax Raad <[email protected]> | 2026-01-29 23:07:58 -0500 |
| commit | 5cfb5fdd0664632956056a1004ab1857a8eb3673 (patch) | |
| tree | df571be285045a90ae461ce73a966d24f95146a1 /packages/containers/script | |
| parent | 30969dc33e20858a9b7773aa19ad345335a644c1 (diff) | |
| download | opencode-5cfb5fdd0664632956056a1004ab1857a8eb3673.tar.gz opencode-5cfb5fdd0664632956056a1004ab1857a8eb3673.zip | |
ci: add container build workflow
Add prebuilt build images and a publish workflow to speed CI by reusing heavy dependencies.
Diffstat (limited to 'packages/containers/script')
| -rw-r--r-- | packages/containers/script/build.ts | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/packages/containers/script/build.ts b/packages/containers/script/build.ts new file mode 100644 index 000000000..18ae328e1 --- /dev/null +++ b/packages/containers/script/build.ts @@ -0,0 +1,25 @@ +#!/usr/bin/env bun + +import { $ } from "bun" + +const dir = new URL("..", import.meta.url).pathname +process.chdir(dir) + +const reg = process.env.REGISTRY ?? "ghcr.io/anomalyco" +const tag = process.env.TAG ?? "24.04" +const push = process.argv.includes("--push") || process.env.PUSH === "1" + +const images = ["base", "bun-node", "rust", "tauri-linux", "publish"] + +for (const name of images) { + const image = `${reg}/build/${name}:${tag}` + const file = `packages/containers/${name}/Dockerfile` + const arg = name === "base" ? "" : `--build-arg REGISTRY=${reg}` + const cmd = `docker build -f ${file} -t ${image} ${arg} .` + console.log(cmd) + await $`${cmd}` + + if (push) { + await $`docker push ${image}` + } +} |
