Skip to content

Commit

Permalink
docs: finalize README auto-generation
Browse files Browse the repository at this point in the history
Signed-off-by: Emilien Escalle <emilien.escalle@escemi.com>
  • Loading branch information
neilime committed Mar 26, 2024
1 parent 58c8fc2 commit ac80c46
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/workflows/main-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ jobs:
secrets: inherit

generate-readme:
needs: ci
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down
58 changes: 58 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ Run your docker-compose file
```
<!-- end usage -->
## Inputs
<!-- start inputs -->
| **Input** | **Description** | **Default** | **Required** |
Expand All @@ -68,5 +71,60 @@ Run your docker-compose file
<!-- end inputs -->
<!-- start outputs -->
<!-- end outputs -->
## Examples
<!-- start [.github/ghadocs/examples/] -->
<!-- end [.github/ghadocs/examples/] -->
### Example Using environment variables
```yaml
steps:
- uses: actions/checkout@v4
- uses: hoverkraft-tech/compose-action@v1.5.1
with:
compose-file: "./docker/docker-compose.yml"
env:
CUSTOM_VARIABLE: "test"
```
### Example using `services`

Perform `docker-compose up` to some given service instead of all of them

```yaml
steps:
# need checkout before using compose-action
- uses: actions/checkout@v3
- uses: hoverkraft-tech/compose-action@v1.5.1
with:
compose-file: "./docker/docker-compose.yml"
services: |
helloworld2
helloworld3
```

### Example using `up-flags`

Specify flags to pass to the `docker-compose up`. Default is none. Can be used to pass the `--build` flag, for example, if you want persistent volumes to be deleted as well during cleanup. A full list of flags can be found in the [docker-compose up documentation](https://docs.docker.com/compose/reference/up/).

### Example using `down-flags`

Specify flags to pass to the `docker-compose down` command during cleanup. Default is none. Can be used to pass the `--volumes` flag, for example, if you want persistent volumes to be deleted as well during cleanup. A full list of flags can be found in the [docker-compose down documentation](https://docs.docker.com/compose/reference/down/).

### Example using `compose-flags`

Specify flags to pass to the `docker-compose` command. Default is none. A full list of flags can be found in the [docker-compose documentation](https://docs.docker.com/compose/reference/#command-options-overview-and-help).

```yaml
steps:
# need checkout before using compose-action
- uses: actions/checkout@v3
- uses: hoverkraft-tech/compose-action@v1.5.1
with:
compose-file: "./docker/docker-compose.yml"
services: |
helloworld2
helloworld3
```
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: "Docker Compose Action"
description: "Run your docker-compose file"
description: "This action runs your docker-compose file and clean up before action finished"
inputs:
compose-file:
description: "Relative path to compose file(s). It can be a list of files."
Expand Down

0 comments on commit ac80c46

Please sign in to comment.