docs; use docker compose wording instead of docker-compose

This commit is contained in:
Emilien Escalle 2025-01-21 16:27:29 +00:00
parent ad6e7b37dc
commit 99df94c183
6 changed files with 52 additions and 35 deletions

View File

@ -1,7 +1,7 @@
<!-- markdownlint-disable-next-line first-line-heading --> <!-- markdownlint-disable-next-line first-line-heading -->
### Example using `services` ### Example using `services`
Perform `docker-compose up` to some given service instead of all of them Perform `docker compose up` to some given service instead of all of them
```yaml ```yaml
steps: steps:

View File

@ -1,7 +1,7 @@
<!-- markdownlint-disable-next-line first-line-heading --> <!-- markdownlint-disable-next-line first-line-heading -->
### Example using `up-flags` ### Example using `up-flags`
Specify flags to pass to the `docker-compose up`. Default is none. Can be used 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 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 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/). [docker compose up documentation](https://docs.docker.com/compose/reference/up/).

View File

@ -1,9 +1,9 @@
<!-- markdownlint-disable-next-line first-line-heading --> <!-- markdownlint-disable-next-line first-line-heading -->
### Example using `compose-flags` ### Example using `compose-flags`
Specify flags to pass to the `docker-compose` command. Default is none. A full Specify flags to pass to the `docker compose` command. Default is none. A full
list of flags can be found in the list of flags can be found in the
[docker-compose documentation](https://docs.docker.com/compose/reference/#command-options-overview-and-help). [docker compose documentation](https://docs.docker.com/compose/reference/#command-options-overview-and-help).
```yaml ```yaml
steps: steps:

View File

@ -254,3 +254,20 @@ jobs:
echo "Docker compose version is not in $DOCKER_COMPOSE_VERSION version" echo "Docker compose version is not in $DOCKER_COMPOSE_VERSION version"
exit 1 exit 1
fi fi
test-action-with-docker-context:
runs-on: ubuntu-latest
name: Test with docker context
steps:
- uses: actions/checkout@v4
- name: Set up Docker
uses: docker/setup-docker-action@v4
with:
context: test-context
- name: Act
uses: ./
with:
compose-file: "./test/docker-compose.yml"
compose-version: "latest"

View File

@ -19,7 +19,7 @@
</div> </div>
<!-- start description --> <!-- start description -->
This action runs your docker-compose file and clean up before action finished This action runs your [docker compose](https://docs.docker.com/reference/compose-file/) file and clean up before action finished
<!-- end description --> <!-- end description -->
@ -30,16 +30,16 @@ This action runs your docker-compose file and clean up before action finished
### Action ### Action
The action will run `docker-compose up` to start the services defined in the given compose file(s). The action will run `docker compose up` to start the services defined in the given compose file(s).
The compose file(s) can be specified using the `compose-file` input. The compose file(s) can be specified using the `compose-file` input.
Some extra options can be passed to the `docker-compose up` command using the `up-flags` input. Some extra options can be passed to the `docker compose up` command using the `up-flags` input.
### Post hook ### Post hook
On post hook, the action will run `docker-compose down` to clean up the services. On post hook, the action will run `docker compose down` to clean up the services.
In debug mode, the logs of the running services are printed before the cleanup. In debug mode, the logs of the running services are printed before the cleanup.
Some extra options can be passed to the `docker-compose down` command using the `down-flags` input. Some extra options can be passed to the `docker compose down` command using the `down-flags` input.
<!-- start usage --> <!-- start usage -->
@ -52,21 +52,21 @@ Some extra options can be passed to the `docker-compose down` command using the
# Default: ./docker-compose.yml # Default: ./docker-compose.yml
compose-file: "" compose-file: ""
# Description: Services to perform docker-compose up. # Description: Services to perform docker compose up.
# #
services: "" services: ""
# Description: Additional options to pass to `docker-compose up` command. # Description: Additional options to pass to `docker compose up` command.
# #
# Default: # Default:
up-flags: "" up-flags: ""
# Description: Additional options to pass to `docker-compose down` command. # Description: Additional options to pass to `docker compose down` command.
# #
# Default: # Default:
down-flags: "" down-flags: ""
# Description: Additional options to pass to `docker-compose` command. # Description: Additional options to pass to `docker compose` command.
# #
# Default: # Default:
compose-flags: "" compose-flags: ""
@ -82,7 +82,7 @@ Some extra options can be passed to the `docker-compose down` command using the
compose-version: "" compose-version: ""
# Description: The GitHub token used to create an authenticated client (to fetch # Description: The GitHub token used to create an authenticated client (to fetch
# the latest version of docker-compose). # the latest version of docker compose).
# #
# Default: ${{ github.token }} # Default: ${{ github.token }}
github-token: "" github-token: ""
@ -97,13 +97,13 @@ Some extra options can be passed to the `docker-compose down` command using the
| **Input** | **Description** | **Default** | **Required** | | **Input** | **Description** | **Default** | **Required** |
| ---------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------ | ------------ | | ---------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------ | ------------ |
| <code>compose-file</code> | Path to compose file(s). It can be a list of files. It can be absolute or relative to the current working directory (cwd). | <code>./docker-compose.yml</code> | **false** | | <code>compose-file</code> | Path to compose file(s). It can be a list of files. It can be absolute or relative to the current working directory (cwd). | <code>./docker-compose.yml</code> | **false** |
| <code>services</code> | Services to perform docker-compose up. | | **false** | | <code>services</code> | Services to perform docker compose up. | | **false** |
| <code>up-flags</code> | Additional options to pass to <code>docker-compose up</code> command. | | **false** | | <code>up-flags</code> | Additional options to pass to <code>docker compose up</code> command. | | **false** |
| <code>down-flags</code> | Additional options to pass to <code>docker-compose down</code> command. | | **false** | | <code>down-flags</code> | Additional options to pass to <code>docker compose down</code> command. | | **false** |
| <code>compose-flags</code> | Additional options to pass to <code>docker-compose</code> command. | | **false** | | <code>compose-flags</code> | Additional options to pass to <code>docker compose</code> command. | | **false** |
| <code>cwd</code> | Current working directory | <code>${{ github.workspace }}</code> | **false** | | <code>cwd</code> | Current working directory | <code>${{ github.workspace }}</code> | **false** |
| <code>compose-version</code> | Compose version to use.<br />If null (default), it will use the current installed version.<br />If "latest", it will install the latest version. | | **false** | | <code>compose-version</code> | Compose version to use.<br />If null (default), it will use the current installed version.<br />If "latest", it will install the latest version. | | **false** |
| <code>github-token</code> | The GitHub token used to create an authenticated client (to fetch the latest version of docker-compose). | <code>${{ github.token }}</code> | **false** | | <code>github-token</code> | The GitHub token used to create an authenticated client (to fetch the latest version of docker compose). | <code>${{ github.token }}</code> | **false** |
<!-- end inputs --> <!-- end inputs -->
<!-- start outputs --> <!-- start outputs -->
@ -125,14 +125,14 @@ jobs:
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Run docker-compose - name: Run docker compose
uses: hoverkraft-tech/compose-action@v2.0.1 uses: hoverkraft-tech/compose-action@v2.0.1
with: with:
compose-file: "./docker/docker-compose.yml" compose-file: "./docker/docker-compose.yml"
- name: Execute tests in the running services - name: Execute tests in the running services
run: | run: |
docker-compose exec test-app pytest docker compose exec test-app pytest
``` ```
<!-- start [.github/ghadocs/examples/] --> <!-- start [.github/ghadocs/examples/] -->
@ -152,7 +152,7 @@ steps:
### Example using `services` ### Example using `services`
Perform `docker-compose up` to some given service instead of all of them Perform `docker compose up` to some given service instead of all of them
```yaml ```yaml
steps: steps:
@ -168,24 +168,24 @@ steps:
### Example using `up-flags` ### Example using `up-flags`
Specify flags to pass to the `docker-compose up`. Default is none. Can be used 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 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 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/). [docker compose up documentation](https://docs.docker.com/compose/reference/up/).
### Example using `down-flags` ### Example using `down-flags`
Specify flags to pass to the `docker-compose down` command during cleanup. 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 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 want persistent volumes to be deleted as well during cleanup. A full list of
flags can be found in the flags can be found in the
[docker-compose down documentation](https://docs.docker.com/compose/reference/down/). [docker compose down documentation](https://docs.docker.com/compose/reference/down/).
### Example using `compose-flags` ### Example using `compose-flags`
Specify flags to pass to the `docker-compose` command. Default is none. A full Specify flags to pass to the `docker compose` command. Default is none. A full
list of flags can be found in the list of flags can be found in the
[docker-compose documentation](https://docs.docker.com/compose/reference/#command-options-overview-and-help). [docker compose documentation](https://docs.docker.com/compose/reference/#command-options-overview-and-help).
```yaml ```yaml
steps: steps:

View File

@ -1,5 +1,5 @@
name: "Docker Compose Action" name: "Docker Compose Action"
description: "This action runs your docker-compose file and clean up before action finished" description: "This action runs your compose file and clean up before action finished"
author: "Hoverkraft" author: "Hoverkraft"
branding: branding:
icon: anchor icon: anchor
@ -11,18 +11,18 @@ inputs:
required: false required: false
default: "./docker-compose.yml" default: "./docker-compose.yml"
services: services:
description: "Services to perform docker-compose up." description: "Services to perform docker compose up."
required: false required: false
up-flags: up-flags:
description: "Additional options to pass to `docker-compose up` command." description: "Additional options to pass to `docker compose up` command."
required: false required: false
default: "" default: ""
down-flags: down-flags:
description: "Additional options to pass to `docker-compose down` command." description: "Additional options to pass to `docker compose down` command."
required: false required: false
default: "" default: ""
compose-flags: compose-flags:
description: "Additional options to pass to `docker-compose` command." description: "Additional options to pass to `docker compose` command."
required: false required: false
default: "" default: ""
cwd: cwd:
@ -36,7 +36,7 @@ inputs:
If "latest", it will install the latest version. If "latest", it will install the latest version.
required: false required: false
github-token: github-token:
description: The GitHub token used to create an authenticated client (to fetch the latest version of docker-compose). description: The GitHub token used to create an authenticated client (to fetch the latest version of docker compose).
default: ${{ github.token }} default: ${{ github.token }}
required: false required: false