From 7a99ffa359cbce3691a9bf166efd1c77f3033b7f Mon Sep 17 00:00:00 2001 From: Chuck Ha Date: Mon, 8 Jul 2019 12:30:06 -0400 Subject: [PATCH 1/2] Update main.workflow with secrets At the very least the login should succeed --- .github/main.workflow | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/.github/main.workflow b/.github/main.workflow index b45bb2a..aa8a2bd 100644 --- a/.github/main.workflow +++ b/.github/main.workflow @@ -1,17 +1,21 @@ workflow "New workflow" { on = "push" - resolves = ["./scripts/publish-manager.sh"] + resolves = ["push"] } action "Docker Registry" { uses = "actions/docker/login@86ff551d26008267bb89ac11198ba7f1d807b699" + secrets = ["DOCKER_USERNAME", "DOCKER_PASSWORD", "DOCKER_REGISTRY_URL"] } -action "./scripts/publish-manager.sh" { - uses = "./scripts/publish-manager.sh" +action "build" { + uses = "actions/docker/cli@master" needs = ["Docker Registry"] - env = { - TAG = "latest" - REGISTRY = "docker.pkg.github.com/kubernetes-sigs/cluster-api-provider-docker" - } + args = "build -t docker.pkg.github.com/kubernetes-sigs/cluster-api-provider-docker:latest ." +} + +action "push" { + uses = "actions/docker/cli@master" + needs = ["build"] + args = "push docker.pkg.github.com/kubernetes-sigs/cluster-api-provider-docker:latest" } From 206e15a777a9b1741fafa4d34a63c396de33978c Mon Sep 17 00:00:00 2001 From: Chuck Ha Date: Mon, 8 Jul 2019 14:25:28 -0400 Subject: [PATCH 2/2] Publish container image on push to master Signed-off-by: Chuck Ha --- .github/main.workflow | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/main.workflow b/.github/main.workflow index aa8a2bd..b07ec7e 100644 --- a/.github/main.workflow +++ b/.github/main.workflow @@ -14,8 +14,14 @@ action "build" { args = "build -t docker.pkg.github.com/kubernetes-sigs/cluster-api-provider-docker:latest ." } +action "master" { + needs = ["build"] + uses = "actions/bin/filter@master" + args = "branch master" +} + action "push" { uses = "actions/docker/cli@master" - needs = ["build"] + needs = ["master"] args = "push docker.pkg.github.com/kubernetes-sigs/cluster-api-provider-docker:latest" }