30 lines
708 B
HCL
30 lines
708 B
HCL
workflow "Build and push" {
|
|
on = "push"
|
|
resolves = ["Login", "Push"]
|
|
}
|
|
|
|
action "Login" {
|
|
uses = "actions/docker/login@04185cf"
|
|
secrets = ["DOCKER_USERNAME", "DOCKER_PASSWORD"]
|
|
}
|
|
|
|
action "Pull" {
|
|
uses = "actions/docker/cli@04185cf"
|
|
needs = ["Login"]
|
|
args = "pull $DOCKER_USERNAME/$DOCKER_IMAGE"
|
|
secrets = ["DOCKER_USERNAME", "DOCKER_IMAGE"]
|
|
}
|
|
|
|
action "Build" {
|
|
uses = "actions/docker/cli@04185cf"
|
|
needs = ["Pull"]
|
|
args = "build -t $DOCKER_USERNAME/$DOCKER_IMAGE ."
|
|
secrets = ["DOCKER_USERNAME", "DOCKER_IMAGE"]
|
|
}
|
|
|
|
action "Push" {
|
|
uses = "actions/docker/cli@04185cf"
|
|
needs = ["Build"]
|
|
args = "push $DOCKER_USERNAME/$DOCKER_IMAGE"
|
|
secrets = ["DOCKER_USERNAME", "DOCKER_IMAGE"]
|
|
}
|