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