mirror of
https://github.com/hoverkraft-tech/compose-action.git
synced 2026-01-12 23:53:07 +08:00
feat: add support for compose env variables (#9)
Co-authored-by: Emilien Escalle <emilien.escalle@escemi.com>
This commit is contained in:
parent
234ccc8f01
commit
f11945c961
7
.github/workflows/main.yml
vendored
7
.github/workflows/main.yml
vendored
@ -25,6 +25,11 @@ jobs:
|
|||||||
compose-file: "./docker/docker-compose.yml"
|
compose-file: "./docker/docker-compose.yml"
|
||||||
compose-flags: "--profile profile-1"
|
compose-flags: "--profile profile-1"
|
||||||
down-flags: "--volumes"
|
down-flags: "--volumes"
|
||||||
|
- uses: ./
|
||||||
|
with:
|
||||||
|
compose-file: "./docker/docker-compose-with-env.yml"
|
||||||
|
env:
|
||||||
|
IMAGE_NAME: hello-world
|
||||||
- uses: ./
|
- uses: ./
|
||||||
with:
|
with:
|
||||||
compose-file: |
|
compose-file: |
|
||||||
@ -32,4 +37,4 @@ jobs:
|
|||||||
./docker/docker-compose.ci.yml
|
./docker/docker-compose.ci.yml
|
||||||
services: |
|
services: |
|
||||||
helloworld2
|
helloworld2
|
||||||
helloworld4
|
helloworld4
|
||||||
|
|||||||
12
README.md
12
README.md
@ -46,3 +46,15 @@ steps:
|
|||||||
helloworld2
|
helloworld2
|
||||||
helloworld3
|
helloworld3
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Using environment variables
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: isbang/compose-action@v1.2.0
|
||||||
|
with:
|
||||||
|
compose-file: "./docker/docker-compose.yml"
|
||||||
|
env:
|
||||||
|
CUSTOM_VARIABLE: "test"
|
||||||
|
```
|
||||||
|
|||||||
8
docker/docker-compose-with-env.yml
Normal file
8
docker/docker-compose-with-env.yml
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
version: "3.8"
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
test_volume: {}
|
||||||
|
|
||||||
|
services:
|
||||||
|
helloworld:
|
||||||
|
image: ${IMAGE_NAME}
|
||||||
1
main.js
1
main.js
@ -18,6 +18,7 @@ try {
|
|||||||
commandOptions: utils.parseFlags(core.getInput("up-flags")),
|
commandOptions: utils.parseFlags(core.getInput("up-flags")),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const services = core.getMultilineInput("services", { required: false });
|
||||||
const promise =
|
const promise =
|
||||||
services.length > 0
|
services.length > 0
|
||||||
? compose.upMany(services, options)
|
? compose.upMany(services, options)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user