Skip to content
This repository has been archived by the owner on Sep 24, 2021. It is now read-only.

Build container image on all pushes and publish image on push to master #75

Merged
merged 2 commits into from
Jul 8, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 17 additions & 7 deletions .github/main.workflow
Original file line number Diff line number Diff line change
@@ -1,17 +1,27 @@
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"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these injected automatically?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh no, they are not. I had to create the secrets as an admin. There is a better way to do it with gpg which we should probably look into and use a robot user for these values instead of my personal account

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, that's disappointing, it would be nice if there was cleaner integration with github package repository.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can the GitHub Token secret be used for this purpose instead of adding additional secrets?

}

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 "master" {
needs = ["build"]
uses = "actions/bin/filter@master"
args = "branch master"
}

action "push" {
uses = "actions/docker/cli@master"
needs = ["master"]
args = "push docker.pkg.github.com/kubernetes-sigs/cluster-api-provider-docker:latest"
}