Skip to content

Commit 748a282

Browse files
committed
Add support for customized Docker Compose file location
1 parent f122a5b commit 748a282

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

Diff for: action.yml

+11-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ inputs:
1414
description: 'Endpoint of your Docker instance (xxxxxx.stackhero-network.com or your customized domain)'
1515
required: true
1616

17+
dockerComposeFile:
18+
description: 'Docker Compose file (e.g. "docker-compose.yml" or "docker/docker-compose.yml")'
19+
required: false
20+
default: 'docker-compose.yml'
21+
1722
runs:
1823
using: "composite"
1924
steps:
@@ -64,4 +69,9 @@ runs:
6469
git fetch --unshallow origin
6570
printenv > env.list
6671
docker context use ${{ inputs.endpoint }}
67-
docker compose --env-file env.list up -d
72+
if [ ! -f "${{ inputs.dockerComposeFile }}"" ]
73+
then
74+
echo "::error::Can't find the Docker Compose file \"${{ inputs.dockerComposeFile }}\"."
75+
exit 1
76+
fi
77+
docker compose --env-file env.list --file ${{ inputs.dockerComposeFile }} up -d

0 commit comments

Comments
 (0)