Update README

This commit is contained in:
Peter Evans 2019-08-12 14:18:43 +09:00
parent 96ab422aa6
commit a556e80cb3

View file

@ -8,11 +8,13 @@ This is useful if you `docker push` your images to Docker Hub. It provides an ea
## Usage
```hcl
action "Docker Hub Description" {
uses = "peter-evans/dockerhub-description@v1.0.1"
secrets = ["DOCKERHUB_USERNAME", "DOCKERHUB_PASSWORD", "DOCKERHUB_REPOSITORY"]
}
```yml
- name: Docker Hub Description
uses: peter-evans/dockerhub-description@v1.0.1
env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}
DOCKERHUB_REPOSITORY: ${{ secrets.DOCKERHUB_REPOSITORY }}
```
#### Required secrets
@ -28,48 +30,54 @@ Note that `DOCKERHUB_USERNAME` and `DOCKERHUB_REPOSITORY` may also be environmen
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.
```hcl
action "Docker Hub Description" {
uses = "peter-evans/dockerhub-description@v1.0.1"
secrets = ["DOCKERHUB_USERNAME", "DOCKERHUB_PASSWORD", "DOCKERHUB_REPOSITORY"]
env = {
README_FILEPATH = "./some-path/README.md"
}
}
```yml
- name: Docker Hub Description
uses: peter-evans/dockerhub-description@v1.0.1
env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}
DOCKERHUB_REPOSITORY: ${{ secrets.DOCKERHUB_REPOSITORY }}
README_FILEPATH: ./some-path/README.md
```
#### Examples
Updates the Docker Hub repository description whenever there is a `git push` to the `master` branch.
```hcl
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.1"
secrets = ["DOCKERHUB_USERNAME", "DOCKERHUB_PASSWORD", "DOCKERHUB_REPOSITORY"]
}
```yml
on: push
name: Update Docker Hub Description
jobs:
dockerHubDescription:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Filter master branch
uses: actions/bin/filter@master
with:
args: branch master
- name: Docker Hub Description
uses: peter-evans/dockerhub-description@v1.0.1
env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}
DOCKERHUB_REPOSITORY: ${{ secrets.DOCKERHUB_REPOSITORY }}
```
Updates the Docker Hub repository description whenever a new release is created.
```hcl
workflow "Update Docker Hub Description" {
resolves = ["Docker Hub Description"]
on = "release"
}
action "Docker Hub Description" {
uses = "peter-evans/dockerhub-description@v1.0.1"
secrets = ["DOCKERHUB_USERNAME", "DOCKERHUB_PASSWORD", "DOCKERHUB_REPOSITORY"]
}
```yml
on: release
name: Update Docker Hub Description
jobs:
dockerHubDescription:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Docker Hub Description
uses: peter-evans/dockerhub-description@v1.0.1
env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}
DOCKERHUB_REPOSITORY: ${{ secrets.DOCKERHUB_REPOSITORY }}
```
## Using the Docker image independently of GitHub Actions