mirror of
https://github.com/hoverkraft-tech/compose-action.git
synced 2026-01-12 07:33:06 +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-flags: "--profile profile-1"
|
||||
down-flags: "--volumes"
|
||||
- uses: ./
|
||||
with:
|
||||
compose-file: "./docker/docker-compose-with-env.yml"
|
||||
env:
|
||||
IMAGE_NAME: hello-world
|
||||
- uses: ./
|
||||
with:
|
||||
compose-file: |
|
||||
@ -32,4 +37,4 @@ jobs:
|
||||
./docker/docker-compose.ci.yml
|
||||
services: |
|
||||
helloworld2
|
||||
helloworld4
|
||||
helloworld4
|
||||
|
||||
12
README.md
12
README.md
@ -46,3 +46,15 @@ steps:
|
||||
helloworld2
|
||||
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}
|
||||
Loading…
x
Reference in New Issue
Block a user