Compare commits

...

7 Commits

Author SHA1 Message Date
hoverkraft-bot[bot]
b9f10db4fd docs: update actions and workflows documentation
[skip ci]

Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-09-30 13:49:33 +00:00
dependabot[bot]
b716db5b71 chore(deps): bump hoverkraft-tech/ci-dokumentor
Bumps the github-actions-dependencies group with 1 update:
[hoverkraft-tech/ci-dokumentor](https://github.com/hoverkraft-tech/ci-dokumentor).

---
updated-dependencies:
- dependency-name: hoverkraft-tech/ci-dokumentor
  dependency-version: 0.1.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Emilien Escalle <emilien.escalle@escemi.com>
2025-09-30 15:31:16 +02:00
copilot-swe-agent[bot]
88b85ef80e docs: improve compose-flags example
Signed-off-by: Emilien Escalle <emilien.escalle@escemi.com>
2025-09-30 13:11:11 +02:00
dependabot[bot]
ab0fa7d95d chore(deps): bump docker-compose from 1.2.0 to 1.3.0
Bumps [docker-compose](https://github.com/PDMLab/docker-compose) from 1.2.0 to 1.3.0.
- [Changelog](https://github.com/PDMLab/docker-compose/blob/master/CHANGELOG.md)
- [Commits](https://github.com/PDMLab/docker-compose/compare/v1.2.0...v1.3.0)

---
updated-dependencies:
- dependency-name: docker-compose
  dependency-version: 1.3.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Emilien Escalle <emilien.escalle@escemi.com>
2025-09-30 13:06:28 +02:00
dependabot[bot]
82f56cc549 chore(deps): bump docker-compose from 1.2.0 to 1.3.0
Bumps [docker-compose](https://github.com/PDMLab/docker-compose) from 1.2.0 to 1.3.0.
- [Changelog](https://github.com/PDMLab/docker-compose/blob/master/CHANGELOG.md)
- [Commits](https://github.com/PDMLab/docker-compose/compare/v1.2.0...v1.3.0)

---
updated-dependencies:
- dependency-name: docker-compose
  dependency-version: 1.3.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-30 13:06:28 +02:00
dependabot[bot]
650d8e8740 chore(deps-dev): bump the npm-dev-dependencies group across 1 directory with 2 updates
Bumps the npm-dev-dependencies group with 2 updates in the / directory:
[@ts-dev-tools/core](https://github.com/escemi-tech/ts-dev-tools)
and [@vercel/ncc](https://github.com/vercel/ncc).

---
updated-dependencies:
- dependency-name: "@ts-dev-tools/core"
  dependency-version: 1.9.6
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm-dev-dependencies
- dependency-name: "@vercel/ncc"
  dependency-version: 0.38.4
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm-dev-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-30 12:56:58 +02:00
dependabot[bot]
b49a5ca3bb chore(deps): bump the github-actions-dependencies group across 1 directory with 3 updates
Bumps the github-actions-dependencies group with 3 updates in the / directory:
[hoverkraft-tech/ci-github-common](https://github.com/hoverkraft-tech/ci-github-common),
[hoverkraft-tech/ci-dokumentor](https://github.com/hoverkraft-tech/ci-dokumentor)
and [actions/create-github-app-token](https://github.com/actions/create-github-app-token).

---
updated-dependencies:
- dependency-name: hoverkraft-tech/ci-github-common
  dependency-version: 0.25.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions-dependencies
- dependency-name: hoverkraft-tech/ci-dokumentor
  dependency-version: 0.1.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions-dependencies
- dependency-name: actions/create-github-app-token
  dependency-version: 2.1.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Emilien Escalle <emilien.escalle@escemi.com>
2025-09-30 12:43:55 +02:00
12 changed files with 70 additions and 56 deletions

View File

@ -13,7 +13,7 @@ permissions:
jobs:
linter:
uses: hoverkraft-tech/ci-github-common/.github/workflows/linter.yml@b4883995e100e291a1fed68678d47a560328ed08 # 0.24.0
uses: hoverkraft-tech/ci-github-common/.github/workflows/linter.yml@d324c777132734fc988c79a74dff3ee0248835fc # 0.25.0
with:
linter-env: |
FILTER_REGEX_EXCLUDE=dist/**/*

View File

@ -13,4 +13,4 @@ permissions:
jobs:
greetings:
uses: hoverkraft-tech/ci-github-common/.github/workflows/greetings.yml@b4883995e100e291a1fed68678d47a560328ed08 # 0.24.0
uses: hoverkraft-tech/ci-github-common/.github/workflows/greetings.yml@d324c777132734fc988c79a74dff3ee0248835fc # 0.25.0

View File

@ -36,17 +36,17 @@ jobs:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: 📖 Generate documentation
uses: hoverkraft-tech/ci-dokumentor@002e0be35c188aa703fcc656d2db8f128800f723 # 0.1.0
uses: hoverkraft-tech/ci-dokumentor@fe7b78e19572b70e2a5db7f2a61b99c70358061a # 0.1.2
with:
source: action.yml
- uses: actions/create-github-app-token@a8d616148505b5069dccd32f177bb87d7f39123b # v2.1.1
- uses: actions/create-github-app-token@67018539274d69449ef7c02e8e71183d1719ab42 # v2.1.4
id: generate-token
with:
app-id: ${{ vars.CI_BOT_APP_ID }}
private-key: ${{ secrets.CI_BOT_APP_PRIVATE_KEY }}
- uses: hoverkraft-tech/ci-github-common/actions/create-and-merge-pull-request@b4883995e100e291a1fed68678d47a560328ed08 # 0.24.0
- uses: hoverkraft-tech/ci-github-common/actions/create-and-merge-pull-request@d324c777132734fc988c79a74dff3ee0248835fc # 0.25.0
with:
github-token: ${{ steps.generate-token.outputs.token }}
branch: docs/actions-workflows-documentation-update

View File

@ -21,7 +21,7 @@ permissions:
jobs:
main:
uses: hoverkraft-tech/ci-github-common/.github/workflows/need-fix-to-issue.yml@b4883995e100e291a1fed68678d47a560328ed08 # 0.24.0
uses: hoverkraft-tech/ci-github-common/.github/workflows/need-fix-to-issue.yml@d324c777132734fc988c79a74dff3ee0248835fc # 0.25.0
with:
manual-commit-ref: ${{ inputs.manual-commit-ref }}
manual-base-ref: ${{ inputs.manual-base-ref }}

View File

@ -13,4 +13,4 @@ permissions:
jobs:
main:
uses: hoverkraft-tech/ci-github-common/.github/workflows/semantic-pull-request.yml@b4883995e100e291a1fed68678d47a560328ed08 # 0.24.0
uses: hoverkraft-tech/ci-github-common/.github/workflows/semantic-pull-request.yml@d324c777132734fc988c79a74dff3ee0248835fc # 0.25.0

View File

@ -10,4 +10,4 @@ permissions:
jobs:
main:
uses: hoverkraft-tech/ci-github-common/.github/workflows/stale.yml@b4883995e100e291a1fed68678d47a560328ed08 # 0.24.0
uses: hoverkraft-tech/ci-github-common/.github/workflows/stale.yml@d324c777132734fc988c79a74dff3ee0248835fc # 0.25.0

View File

@ -37,7 +37,7 @@ Some extra options can be passed to the `docker compose up` command using the `u
On post hook, the action will run `docker compose down` to clean up the services.
Logs of the Docker Compose services are logged using GitHub `core.ts` API before the cleanup.
The log level can be set using the `services-log-level` input.
The log level can be set using the `services-log-level` input.
The default is `debug`, which will only print logs if [debug mode](https://docs.github.com/en/actions/monitoring-and-troubleshooting-workflows/troubleshooting-workflows/enabling-debug-logging) is switched on.
Some extra options can be passed to the `docker compose down` command using the `down-flags` input.
@ -48,7 +48,7 @@ Some extra options can be passed to the `docker compose down` command using the
## Usage
```yaml
- uses: hoverkraft-tech/compose-action@40041ff1b97dbf152cd2361138c2b03fa29139df # v2.3.0
- uses: hoverkraft-tech/compose-action@b716db5b717cb9b81e391fe638e5aceaa2299e43 # v2.4.0
with:
# Additional options to pass to `docker` command.
docker-flags: ""
@ -123,6 +123,8 @@ Some extra options can be passed to the `docker compose down` command using the
## Examples
### Example using in a full workflow
```yaml
name: Docker Compose Action
@ -136,7 +138,7 @@ jobs:
- uses: actions/checkout@v4.2.2
- name: Run docker compose
uses: hoverkraft-tech/compose-action@40041ff1b97dbf152cd2361138c2b03fa29139df # v2.3.0
uses: hoverkraft-tech/compose-action@b716db5b717cb9b81e391fe638e5aceaa2299e43 # v2.4.0
with:
compose-file: "./docker/docker-compose.yml"
@ -145,23 +147,27 @@ jobs:
docker compose exec test-app pytest
```
### Example Using environment variables
```yaml
steps:
- uses: actions/checkout@v4.2.2
- uses: hoverkraft-tech/compose-action@40041ff1b97dbf152cd2361138c2b03fa29139df # v2.3.0
- uses: hoverkraft-tech/compose-action@b716db5b717cb9b81e391fe638e5aceaa2299e43 # v2.4.0
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@40041ff1b97dbf152cd2361138c2b03fa29139df # v2.3.0
- uses: hoverkraft-tech/compose-action@b716db5b717cb9b81e391fe638e5aceaa2299e43 # v2.4.0
with:
compose-file: "./docker/docker-compose.yml"
services: |
@ -169,6 +175,8 @@ steps:
helloworld3
```
### Example using `up-flags`
Specify flags to pass to the `docker compose up`.
Default is none.
@ -177,6 +185,8 @@ Can be used to pass the `--build` flag, for example, if you want persistent volu
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.
@ -185,6 +195,8 @@ Can be used to pass the want persistent volumes to be deleted as well during cle
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).
@ -193,12 +205,10 @@ A full list of flags can be found in the [Docker compose documentation](https://
steps:
# need checkout before using compose-action
- uses: actions/checkout@v3
- uses: hoverkraft-tech/compose-action@40041ff1b97dbf152cd2361138c2b03fa29139df # v2.3.0
- uses: hoverkraft-tech/compose-action@b716db5b717cb9b81e391fe638e5aceaa2299e43 # v2.4.0
with:
compose-file: "./docker/docker-compose.yml"
services: |
helloworld2
helloworld3
compose-flags: "--profile profile-1"
```
Specify multiple compose files to use with the `docker compose` command.
@ -209,7 +219,7 @@ This is useful when you have a base compose file and additional files for differ
steps:
# need checkout before using compose-action
- uses: actions/checkout@v3
- uses: hoverkraft-tech/compose-action@40041ff1b97dbf152cd2361138c2b03fa29139df # v2.3.0
- uses: hoverkraft-tech/compose-action@b716db5b717cb9b81e391fe638e5aceaa2299e43 # v2.4.0
with:
compose-file: |
./docker/docker-compose.yml

View File

@ -1,23 +1,20 @@
# ### Action
#
# 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.
# Some extra options can be passed to the `docker compose up` command using the `up-flags` input.
#
# ### Post hook
#
# On post hook, the action will run `docker compose down` to clean up the services.
#
# Logs of the Docker Compose services are logged using GitHub `core.ts` API before the cleanup.
# The log level can be set using the `services-log-level` input.
# The default is `debug`, which will only print logs if [debug mode](https://docs.github.com/en/actions/monitoring-and-troubleshooting-workflows/troubleshooting-workflows/enabling-debug-logging) is switched on.
#
# Some extra options can be passed to the `docker compose down` command using the `down-flags` input.
name: "Docker Compose Action"
description: |
This action runs your compose file(s) and clean up before action finished
### Action
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.
Some extra options can be passed to the `docker compose up` command using the `up-flags` input.
### Post hook
On post hook, the action will run `docker compose down` to clean up the services.
Logs of the Docker Compose services are logged using GitHub `core.ts` API before the cleanup.
The log level can be set using the `services-log-level` input.
The default is `debug`, which will only print logs if [debug mode](https://docs.github.com/en/actions/monitoring-and-troubleshooting-workflows/troubleshooting-workflows/enabling-debug-logging) is switched on.
Some extra options can be passed to the `docker compose down` command using the `down-flags` input.
description: This action runs your compose file(s) and clean up before action finished
author: "hoverkraft"
branding:
icon: anchor

7
dist/index.js generated vendored
View File

@ -10321,9 +10321,12 @@ const restartOne = function (service, options) {
};
exports.restartOne = restartOne;
const logs = function (services, options = {}) {
let args = Array.isArray(services) ? services : [services];
const args = Array.isArray(services) ? services : [services];
if (options.follow) {
args = ['--follow', ...args];
args.unshift('--follow');
}
if (options.timestamps) {
args.unshift('--timestamps');
}
return (0, exports.execCompose)('logs', args, options);
};

7
dist/post.js generated vendored
View File

@ -3610,9 +3610,12 @@ const restartOne = function (service, options) {
};
exports.restartOne = restartOne;
const logs = function (services, options = {}) {
let args = Array.isArray(services) ? services : [services];
const args = Array.isArray(services) ? services : [services];
if (options.follow) {
args = ['--follow', ...args];
args.unshift('--follow');
}
if (options.timestamps) {
args.unshift('--timestamps');
}
return (0, exports.execCompose)('logs', args, options);
};

25
package-lock.json generated
View File

@ -13,11 +13,11 @@
"@actions/github": "^6.0.1",
"@actions/tool-cache": "^2.0.2",
"@octokit/action": "^8.0.2",
"docker-compose": "^1.2.0"
"docker-compose": "^1.3.0"
},
"devDependencies": {
"@ts-dev-tools/core": "^1.9.5",
"@vercel/ncc": "^0.38.3",
"@ts-dev-tools/core": "^1.9.6",
"@vercel/ncc": "^0.38.4",
"eslint-plugin-github": "^6.0.0",
"eslint-plugin-jsonc": "^2.20.1"
},
@ -2690,9 +2690,9 @@
}
},
"node_modules/@ts-dev-tools/core": {
"version": "1.9.5",
"resolved": "https://registry.npmjs.org/@ts-dev-tools/core/-/core-1.9.5.tgz",
"integrity": "sha512-i5MKnEx8wtaU4VIitl+ddtLzV0vNpQQZYeYnZEYrKb7gBhaABNXjTnhYJCBNdKi/ExqlNc+QtCNuzbTP2hh2YA==",
"version": "1.9.6",
"resolved": "https://registry.npmjs.org/@ts-dev-tools/core/-/core-1.9.6.tgz",
"integrity": "sha512-jTn6iz39gU7mK+X+QaYQ/bWs+uzJ8eQKsD8elxd0Q2ec5Lh4ZTGti5lNGXV8UO3OnPYCNjVKBmhj6hYqgZ3MUg==",
"dev": true,
"license": "MIT",
"dependencies": {
@ -4748,10 +4748,11 @@
]
},
"node_modules/@vercel/ncc": {
"version": "0.38.3",
"resolved": "https://registry.npmjs.org/@vercel/ncc/-/ncc-0.38.3.tgz",
"integrity": "sha512-rnK6hJBS6mwc+Bkab+PGPs9OiS0i/3kdTO+CkI8V0/VrW3vmz7O2Pxjw/owOlmo6PKEIxRSeZKv/kuL9itnpYA==",
"version": "0.38.4",
"resolved": "https://registry.npmjs.org/@vercel/ncc/-/ncc-0.38.4.tgz",
"integrity": "sha512-8LwjnlP39s08C08J5NstzriPvW1SP8Zfpp1BvC2sI35kPeZnHfxVkCwu4/+Wodgnd60UtT1n8K8zw+Mp7J9JmQ==",
"dev": true,
"license": "MIT",
"bin": {
"ncc": "dist/ncc/cli.js"
}
@ -5932,9 +5933,9 @@
}
},
"node_modules/docker-compose": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/docker-compose/-/docker-compose-1.2.0.tgz",
"integrity": "sha512-wIU1eHk3Op7dFgELRdmOYlPYS4gP8HhH1ZmZa13QZF59y0fblzFDFmKPhyc05phCy2hze9OEvNZAsoljrs+72w==",
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/docker-compose/-/docker-compose-1.3.0.tgz",
"integrity": "sha512-7Gevk/5eGD50+eMD+XDnFnOrruFkL0kSd7jEG4cjmqweDSUhB7i0g8is/nBdVpl+Bx338SqIB2GLKm32M+Vs6g==",
"license": "MIT",
"dependencies": {
"yaml": "^2.2.2"

View File

@ -28,11 +28,11 @@
"@actions/github": "^6.0.1",
"@actions/tool-cache": "^2.0.2",
"@octokit/action": "^8.0.2",
"docker-compose": "^1.2.0"
"docker-compose": "^1.3.0"
},
"devDependencies": {
"@ts-dev-tools/core": "^1.9.5",
"@vercel/ncc": "^0.38.3",
"@ts-dev-tools/core": "^1.9.6",
"@vercel/ncc": "^0.38.4",
"eslint-plugin-github": "^6.0.0",
"eslint-plugin-jsonc": "^2.20.1"
},