This commit is contained in:
Lars Gohr
2019-02-23 13:31:55 +01:00
parent ad04788e66
commit 24e44a6fad
3 changed files with 64 additions and 2 deletions

View File

@@ -1,2 +1,36 @@
# Publish-Docker-Github-Action
A Github Action which uses the Git branch as the Docker tag for pushing to DockerHub
# Publishes docker containers to Dockerhub
This Action for [Docker](https://www.docker.com/) uses the Git branch as the Docker tag for building and pushing the container to DockerHub.
Hereby the master-branch is published as the latest-tag.
## Usage
An example workflow:
```hcl
workflow "Publish Docker" {
on = "push"
resolves = ["logout"]
}
action "login" {
uses = "actions/docker/login@8cdf801b322af5f369e00d85e9cf3a7122f49108"
secrets = ["DOCKER_PASSWORD", "DOCKER_USERNAME"]
}
action "publish" {
uses = "actions/publish-docker@master"
args = "myDocker/repository"
needs = ["login"]
}
action "logout" {
uses = "actions/docker/cli@8cdf801b322af5f369e00d85e9cf3a7122f49108"
args = "logout"
needs = ["publish"]
}
```
## Argument
You need to provide the desired docker repository to the action.