Github Action for envsubst of multiple files in place
This action allows you to substitute environment variables in files.
Will replace all
deployment.json (BEFORE)
{
"version": "${VERSION}",
"instance": "$INSTANCE"
}
ACTION
- uses: tvarohohlavy/inplace-envsubst-action@v1.0.0
env:
VERSION: 1.2.3
INSTANCE: staging
with:
files: |
deployment.json
deployment.json (AFTER)
{
"version": "1.2.3",
"instance": "staging"
}
ACTION
- uses: tvarohohlavy/inplace-envsubst-action@v1.0.0
env:
VERSION: 1.2.3
INSTANCE: staging
with:
files: |
deployment.json
test.json
apps/Dockerfile
by listing varaibles you want to have replaced you can override default behaviour of envsubst which does replace all found
ACTION
- uses: tvarohohlavy/inplace-envsubst-action@v1.0.0
env:
VERSION: 1.2.3
INSTANCE: staging
USER: devops
with:
variables: |
$VERSION
$INSTANCE
files: |
deployment.json
test.json
apps/Dockerfile