dockerhub-description/README.md

75 lines
2.9 KiB
Markdown
Raw Normal View History

2019-06-25 12:33:09 +02:00
# Docker Hub Description
2019-06-25 12:53:47 +02:00
[![GitHub Marketplace](https://img.shields.io/badge/Marketplace-Docker%20Hub%20Description-blue.svg?colorA=24292e&colorB=0366d6&style=flat&longCache=true&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAM6wAADOsB5dZE0gAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAERSURBVCiRhZG/SsMxFEZPfsVJ61jbxaF0cRQRcRJ9hlYn30IHN/+9iquDCOIsblIrOjqKgy5aKoJQj4O3EEtbPwhJbr6Te28CmdSKeqzeqr0YbfVIrTBKakvtOl5dtTkK+v4HfA9PEyBFCY9AGVgCBLaBp1jPAyfAJ/AAdIEG0dNAiyP7+K1qIfMdonZic6+WJoBJvQlvuwDqcXadUuqPA1NKAlexbRTAIMvMOCjTbMwl1LtI/6KWJ5Q6rT6Ht1MA58AX8Apcqqt5r2qhrgAXQC3CZ6i1+KMd9TRu3MvA3aH/fFPnBodb6oe6HM8+lYHrGdRXW8M9bMZtPXUji69lmf5Cmamq7quNLFZXD9Rq7v0Bpc1o/tp0fisAAAAASUVORK5CYII=)](https://github.com/marketplace/actions/docker-hub-description)
2019-06-25 12:33:09 +02:00
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
```
2019-06-25 14:10:05 +02:00
action "Docker Hub Description" {
2019-06-25 12:57:50 +02:00
uses = "peter-evans/dockerhub-description@v1.0.0"
2019-06-25 12:33:09 +02:00
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. (This may also be an environment variable 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.
```
2019-06-25 14:10:05 +02:00
action "Docker Hub Description" {
2019-06-25 12:57:50 +02:00
uses = "peter-evans/dockerhub-description@v1.0.0"
2019-06-25 12:33:09 +02:00
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.
```
2019-06-25 14:10:05 +02:00
workflow "Update Docker Hub Description" {
resolves = ["Docker Hub Description"]
2019-06-25 12:33:09 +02:00
on = "push"
}
action "Filter master branch" {
2019-06-25 12:57:50 +02:00
uses = "actions/bin/filter@v1.0.0"
2019-06-25 12:33:09 +02:00
args = "branch master"
}
2019-06-25 14:10:05 +02:00
action "Docker Hub Description" {
2019-06-25 12:33:09 +02:00
needs = ["Filter master branch"]
2019-06-25 12:57:50 +02:00
uses = "peter-evans/dockerhub-description@v1.0.0"
2019-06-25 12:33:09 +02:00
secrets = ["DOCKERHUB_USERNAME", "DOCKERHUB_PASSWORD", "DOCKERHUB_REPOSITORY"]
}
```
Updates the Docker Hub repository description whenever a new release is created.
```
2019-06-25 14:10:05 +02:00
workflow "Update Docker Hub Description" {
resolves = ["Docker Hub Description"]
2019-06-25 12:33:09 +02:00
on = "release"
}
2019-06-25 14:10:05 +02:00
action "Docker Hub Description" {
2019-06-25 12:57:50 +02:00
uses = "peter-evans/dockerhub-description@v1.0.0"
2019-06-25 12:33:09 +02:00
secrets = ["DOCKERHUB_USERNAME", "DOCKERHUB_PASSWORD", "DOCKERHUB_REPOSITORY"]
}
```
## License
MIT License - see the [LICENSE](LICENSE) file for details