Skip to content

Commit bb7d920

Browse files
committed
docs: Update readme file with new options and version.
1 parent eec15e3 commit bb7d920

File tree

1 file changed

+28
-24
lines changed

1 file changed

+28
-24
lines changed

README.md

Lines changed: 28 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,92 +1,96 @@
11
# Docker Compose Action
22

3-
This action runs your docker-compose file, allows you to run tests and cleans up before action finished.
3+
This GitHub Action allows you to run your `docker-compose` files, specify services to bring up, execute tests in containers, and clean up afterward. It simplifies running tests within a containerized environment in your CI/CD pipelines.
44

55
## Inputs
66

77
### `compose-file`
88

9-
**Optional** The name of the compose file. Default `"./docker-compose.yml"`.
9+
**Optional** - The path to the Docker Compose file(s). Default: `"./docker-compose.yml"`.
1010

11-
It can be a list of files:
11+
You can provide a list of files if needed:
1212

13-
```yml
13+
```yaml
1414
compose-file: |
1515
docker-compose.yml
1616
docker-compose.ci.yml
1717
```
1818
1919
### `services`
2020

21-
**Optional** Just perform `docker-compose up` to one service instead of all of them
21+
**Optional** - The specific services to bring up with `docker-compose up`. If not specified, all services in the compose file(s) will be started.
2222

2323
### `up-flags`
2424

25-
**Optional** Used to 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/).
25+
**Optional** - Additional flags to pass to the `docker-compose up` command. Default is none. Useful for passing options like `--build` or `--force-recreate`.
2626

2727
### `down-flags`
2828

29-
**Optional** Used to 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/).
29+
**Optional** - Flags to pass to the `docker-compose down` command during cleanup. Default is none. For example, use `--volumes` if you want to remove volumes.
3030

3131
### `compose-flags`
3232

33-
**Optional** Used to 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).
33+
**Optional** - General flags to pass to the `docker-compose` command. Default is none. These can be used to add global options like `--compatibility` or other Docker Compose features.
3434

3535
### `test-container`
3636

37-
**Optional** Used to specify the container to run the tests in. Default is none. If not specified, no tests will be run.
37+
**Optional** - The name of the container in which to run the tests. If not specified, no tests will be executed.
3838

3939
### `test-command`
4040

41-
**Optional** Used to specify the command to run the tests with. Default is none. If not specified, no tests will be run.
41+
**Optional** - The command used to run the tests within the container. For example, `npm test` for Node.js projects. If not specified, no tests will be run.
42+
43+
### `annotate`
44+
45+
**Optional** - Whether to show the console output of the test run as GitHub Action annotations. Default: `"true"`.
4246

4347
## Example usage
4448

4549
```yaml
4650
steps:
47-
# need checkout before using docker-compose-action
48-
- uses: actions/checkout@v3
49-
- uses: adambirds/docker-compose-action@v1.3.0
51+
# Check out the repository
52+
- uses: actions/checkout@v4
53+
54+
# Run Docker Compose Action
55+
- uses: adambirds/docker-compose-action@v1.5.0
5056
with:
5157
compose-file: "./docker/docker-compose.yml"
58+
up-flags: "--build"
5259
down-flags: "--volumes"
53-
services: |
54-
helloworld2
55-
helloworld3
56-
test-container: helloworld
60+
test-container: "test-container"
5761
test-command: "npm test"
5862
```
5963

6064
### Using environment variables
6165

6266
```yaml
6367
steps:
64-
- uses: actions/checkout@v3
65-
- uses: adambirds/docker-compose-action@v1.3.0
68+
- uses: actions/checkout@v4
69+
- uses: adambirds/docker-compose-action@v1.5.0
6670
with:
6771
compose-file: "./docker/docker-compose.yml"
6872
env:
6973
CUSTOM_VARIABLE: "test"
7074
```
7175

72-
### Run tests on multiple containers
76+
### Running tests on multiple containers
7377

7478
```yaml
7579
steps:
76-
- uses: actions/checkout@v3
77-
- uses: adambirds/docker-compose-action@v1.3.0
80+
- uses: actions/checkout@v4
81+
- uses: adambirds/docker-compose-action@v1.5.0
7882
with:
7983
compose-file: "./docker/docker-compose.yml"
8084
test-container: "container1"
8185
test-command: "npm test"
8286
83-
- uses: adambirds/docker-compose-action@v1.3.0
87+
- uses: adambirds/docker-compose-action@v1.5.0
8488
with:
8589
compose-file: "./docker/docker-compose.yml"
8690
test-container: "container2"
8791
test-command: "npm test"
8892
89-
- uses: adambirds/docker-compose-action@v1.3.0
93+
- uses: adambirds/docker-compose-action@v1.5.0
9094
with:
9195
compose-file: "./docker/docker-compose.yml"
9296
test-container: "container3"

0 commit comments

Comments
 (0)