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 ## Usage
```hcl ```yml
action "Docker Hub Description" { - name: Docker Hub Description
uses = "peter-evans/dockerhub-description@v1.0.1" uses: peter-evans/dockerhub-description@v1.0.1
secrets = ["DOCKERHUB_USERNAME", "DOCKERHUB_PASSWORD", "DOCKERHUB_REPOSITORY"] env:
} DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}
DOCKERHUB_REPOSITORY: ${{ secrets.DOCKERHUB_REPOSITORY }}
``` ```
#### Required secrets #### 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. 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. If this is not the case, the path can be overridden with an environment variable.
```hcl ```yml
action "Docker Hub Description" { - name: Docker Hub Description
uses = "peter-evans/dockerhub-description@v1.0.1" uses: peter-evans/dockerhub-description@v1.0.1
secrets = ["DOCKERHUB_USERNAME", "DOCKERHUB_PASSWORD", "DOCKERHUB_REPOSITORY"] env:
env = { DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
README_FILEPATH = "./some-path/README.md" DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}
} DOCKERHUB_REPOSITORY: ${{ secrets.DOCKERHUB_REPOSITORY }}
} README_FILEPATH: ./some-path/README.md
``` ```
#### Examples #### Examples
Updates the Docker Hub repository description whenever there is a `git push` to the `master` branch. Updates the Docker Hub repository description whenever there is a `git push` to the `master` branch.
```hcl ```yml
workflow "Update Docker Hub Description" { on: push
resolves = ["Docker Hub Description"] name: Update Docker Hub Description
on = "push" jobs:
} dockerHubDescription:
runs-on: ubuntu-latest
action "Filter master branch" { steps:
uses = "actions/bin/filter@master" - uses: actions/checkout@master
args = "branch master" - name: Filter master branch
} uses: actions/bin/filter@master
with:
action "Docker Hub Description" { args: branch master
needs = ["Filter master branch"] - name: Docker Hub Description
uses = "peter-evans/dockerhub-description@v1.0.1" uses: peter-evans/dockerhub-description@v1.0.1
secrets = ["DOCKERHUB_USERNAME", "DOCKERHUB_PASSWORD", "DOCKERHUB_REPOSITORY"] 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. Updates the Docker Hub repository description whenever a new release is created.
```hcl ```yml
workflow "Update Docker Hub Description" { on: release
resolves = ["Docker Hub Description"] name: Update Docker Hub Description
on = "release" jobs:
} dockerHubDescription:
runs-on: ubuntu-latest
action "Docker Hub Description" { steps:
uses = "peter-evans/dockerhub-description@v1.0.1" - uses: actions/checkout@master
secrets = ["DOCKERHUB_USERNAME", "DOCKERHUB_PASSWORD", "DOCKERHUB_REPOSITORY"] - 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 ## Using the Docker image independently of GitHub Actions