From 06e7995158a6592d6993f046a2ab3bc7635ca603 Mon Sep 17 00:00:00 2001 From: Chuck Ha Date: Wed, 24 Jul 2019 10:14:02 -0400 Subject: [PATCH] revamp of tag and push workflow Signed-off-by: Chuck Ha --- .github/main.workflow | 16 +++++++++++++--- .goreleaser.yml | 4 +--- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/.github/main.workflow b/.github/main.workflow index f58338a..84fd58f 100644 --- a/.github/main.workflow +++ b/.github/main.workflow @@ -23,11 +23,21 @@ action "goreleaser" { uses = "docker://goreleaser/goreleaser" secrets = ["GORELEASER_GITHUB_TOKEN"] args = "release" - needs = ["is-tag", "Setup Google Cloud", "Set Credential Helper for Docker"] + needs = ["is-tag"] +} + +action "tag images" { + uses = "actions/docker/tag@master" + args = "capd-manager gcr.io/kubernetes1-226021/capd-manager" + needs = ["goreleaser"] } action "push images" { uses = "actions/docker/cli@master" - args = "images --filter reference=gcr.io/kubernetes1-226021/capd-manager --format '{{.Repository}}:{{.Tag}}' | xargs -n1 docker push" - needs = ["goreleaser"] + runs = "sh -c" + env = { + IMAGE_NAME = gcr.io/kubernetes1-226021/capd-manager + } + args = "source $HOME/.profile && docker push $IMAGE_NAME:latest && docker push $IMAGE_NAME:$IMAGE_REF && docker push $IMAGE_NAME:$IMAGE_SHA && docker push $IMAGE_NAME:$IMAGE_VERSION" + needs = ["tag images", "Set Credential Helper for Docker"] } diff --git a/.goreleaser.yml b/.goreleaser.yml index a08951f..a7405fa 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -44,6 +44,4 @@ dockers: binaries: - capd-manager image_templates: - - "gcr.io/kubernetes1-226021/capd-manager:{{.Version}}" - - "gcr.io/kubernetes1-226021/capd-manager:{{.Major}}.{{.Minor}}" - - "gcr.io/kubernetes1-226021/capd-manager:latest" + - capd-manager