try task + build

This commit is contained in:
2024-06-10 22:20:47 -04:00
parent f43022c3e4
commit afe1b6175c
2 changed files with 22 additions and 13 deletions

View File

@@ -1,8 +1,11 @@
version: '3'
env:
IMAGE: jswank/alpine-cli
NAME: alpine-cli
TAG: latest
vars:
TAG:
sh: 'grep ^FROM Dockerfile | cut -d: -f2'
tasks:
default:
cmds:
@@ -13,3 +16,15 @@ tasks:
- (podman manifest exists {{.IMAGE}}:{{.TAG}} && podman manifest rm {{.IMAGE}}:{{.TAG}}) || true
- podman manifest create {{.IMAGE}}:{{.TAG}}
- podman build --platform linux/amd64,linux/arm64 --manifest {{.IMAGE}}:{{.TAG}} {{.CLI_ARGS}} -f Dockerfile ctx
publish:
desc: publish the image
cmds:
- podman tag {{.IMAGE}}:{{.TAG}} {{.REGISTRY}}/{{.IMAGE}}:{{.ALT_TAG}}
- echo "${{.REGISTRY_PASS_VAR}}" | podman login {{.REGISTRY}} -u {{.REGISTRY_USER}} --password-stdin
- podman manifest push {{.REGISTRY}}/{{.IMAGE}}:{{.ALT_TAG}}
- podman logout {{.REGISTRY}}
vars:
REGISTRY_PASS_VAR: GH_PAT
REGISTRY: ghcr.io
REGISTRY_USER: jswank
ALT_TAG: '{{.TAG}}'