dockerhub-description/README.md
2019-06-26 20:41:46 +09:00

3 KiB

Docker Hub Description

GitHub Marketplace

A GitHub action to update a Docker Hub repository description from README.md.

This is useful if you docker push your images to Docker Hub. It provides an easy, automated way to keep your Docker Hub repository description in sync with your GitHub repository README.md file.

Usage

action "Docker Hub Description" {
  uses = "peter-evans/dockerhub-description@v1.0.0"
  secrets = ["DOCKERHUB_USERNAME", "DOCKERHUB_PASSWORD", "DOCKERHUB_REPOSITORY"]
}

Required secrets

  • DOCKERHUB_USERNAME - Docker Hub username
  • DOCKERHUB_PASSWORD - Docker Hub password
  • DOCKERHUB_REPOSITORY - The name of the Docker Hub repository to update. The action combines this with the username to locate the repository. i.e. username/repository

Note that DOCKERHUB_USERNAME and DOCKERHUB_REPOSITORY may also be environment variables if not considered sensitive.

Optionally specifying the file path

The action assumes that there is a file called README.md located at the root of the repository. If this is not the case, the path can be overridden with an environment variable.

action "Docker Hub Description" {
  uses = "peter-evans/dockerhub-description@v1.0.0"
  secrets = ["DOCKERHUB_USERNAME", "DOCKERHUB_PASSWORD", "DOCKERHUB_REPOSITORY"]
  env = {
    README_FILEPATH = "./some-path/README.md"
  }
}

Examples

Updates the Docker Hub repository description whenever there is a git push to the master branch.

workflow "Update Docker Hub Description" {
  resolves = ["Docker Hub Description"]
  on = "push"
}

action "Filter master branch" {
  uses = "actions/bin/filter@master"
  args = "branch master"
}

action "Docker Hub Description" {
  needs = ["Filter master branch"]
  uses = "peter-evans/dockerhub-description@v1.0.0"
  secrets = ["DOCKERHUB_USERNAME", "DOCKERHUB_PASSWORD", "DOCKERHUB_REPOSITORY"]
}

Updates the Docker Hub repository description whenever a new release is created.

workflow "Update Docker Hub Description" {
  resolves = ["Docker Hub Description"]
  on = "release"
}

action "Docker Hub Description" {
  uses = "peter-evans/dockerhub-description@v1.0.0"
  secrets = ["DOCKERHUB_USERNAME", "DOCKERHUB_PASSWORD", "DOCKERHUB_REPOSITORY"]
}

License

MIT License - see the LICENSE file for details