From 2331a56248e9b40370d921cc975249e8b1b150b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ricardo=20J=20Gonz=C3=A1lez=20C?= <26823011+ricglz@users.noreply.github.com> Date: Fri, 3 Jun 2022 12:06:13 -0500 Subject: [PATCH] Update documentation --- .github/workflows/main.yml | 10 ++++++---- README.md | 12 ++++++++---- action.yml | 31 +++++++++++++++++-------------- docker/docker-compose.yml | 4 ++++ 4 files changed, 35 insertions(+), 22 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d8b116f..59d9c43 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -8,9 +8,11 @@ jobs: - uses: actions/checkout@v2 - uses: ./ with: - compose-file: './docker/docker-compose.yml' - down-flags: '--volumes' + compose-file: "./docker/docker-compose.yml" + down-flags: "--volumes" - uses: ./ with: - compose-file: './docker/docker-compose.yml' - up-one: 'helloworld' + compose-file: "./docker/docker-compose.yml" + services: + - "helloworld2" + - "helloworld3" diff --git a/README.md b/README.md index 2808784..6423d20 100644 --- a/README.md +++ b/README.md @@ -8,14 +8,18 @@ This action runs your docker-compose file and clean up before action finished. **Optional** The name of the compose file. Default `"./docker-compose.yml"`. +### `services` + +**Optional** Just perform `docker-compose up` to one service instead of all of them + +### `up-flags` + +**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/). + ### `down-flags` **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/). -### `up-one` - -**Optional** Just perform `docker-compose up` to one service instead of all of them - ## Example usage ```yaml diff --git a/action.yml b/action.yml index 4dd2527..6b1e865 100644 --- a/action.yml +++ b/action.yml @@ -1,22 +1,25 @@ -name: 'Docker Compose Action' -description: 'Run your docker-compose file' +name: "Docker Compose Action" +description: "Run your docker-compose file" inputs: - compose-file: # id of input - description: 'relative path to compose file' + compose-file: # id of input + description: "relative path to compose file" required: false - default: './docker-compose.yml' - down-flags: # id of input - description: 'additional options to pass to `docker-compose down` command' + default: "./docker-compose.yml" + down-flags: # id of input + description: "additional options to pass to `docker-compose down` command" required: false - default: '' - down-flags: # id of input - description: 'service to perform docker-compose up' + default: "" + services: # id of input + description: "services to perform docker-compose up" required: false - default: '' + up-flags: # id of input + description: "additional options to pass to `docker-compose up` command" + required: false + default: "" runs: - using: 'node12' - main: 'main.js' - post: 'post.js' + using: "node12" + main: "main.js" + post: "post.js" branding: icon: anchor color: blue diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 9d5a4d6..567bb2d 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -8,3 +8,7 @@ services: image: hello-world volumes: - test_volume:/test:Z + helloworld2: + image: hello-world + helloworld3: + image: hello-world