Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ inputs:
private_registry_user:
description: "Private Container Registry Owner"
required: false
private_registry_token_file:
description: "Private Container Registry Token File"
private_registry_token:
description: "Private Container Registry Token"
required: false

runs:
Expand Down
5 changes: 3 additions & 2 deletions src/main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ trap cleanup_trap EXIT HUP INT QUIT PIPE TERM
echo -e "\u001b[36mVerifying Docker and Setting Context."
ssh -p "${INPUT_PORT}" "${INPUT_USER}@${INPUT_HOST}" "docker info" > /dev/null

docker context rm remote --force
docker context create remote --docker "host=ssh://${INPUT_USER}@${INPUT_HOST}:${INPUT_PORT}"
docker context ls
docker context use remote
Expand All @@ -58,9 +59,9 @@ if [ -n "${INPUT_ENV_FILE}" ];then
source "${INPUT_ENV_FILE}"
fi

if [ -n "${INPUT_PRIVATE_REGISTRY}" ] && [ -n "${INPUT_PRIVATE_REGISTRY_USER}" ] && [ -n "${INPUT_PRIVATE_REGISTRY_TOKEN_FILE}" ]; then
if [ -n "${INPUT_PRIVATE_REGISTRY}" ] && [ -n "${INPUT_PRIVATE_REGISTRY_USER}" ] && [ -n "${INPUT_PRIVATE_REGISTRY_TOKEN}" ]; then
echo -e "\u001b[36mLogging in to private registry"
cat "${INPUT_PRIVATE_REGISTRY_TOKEN_FILE}" | docker login --username "${INPUT_PRIVATE_REGISTRY_USER}" "${INPUT_PRIVATE_REGISTRY}" --password-stdin
docker login --username "${INPUT_PRIVATE_REGISTRY_USER}" "${INPUT_PRIVATE_REGISTRY}" "${INPUT_PRIVATE_REGISTRY_TOKEN}"
echo -e "\u001b[36mDeploying Stack: \u001b[37;1m${INPUT_NAME} \u001b[36mwith Registry Auth."
docker stack deploy -c "${INPUT_FILE}" "${INPUT_NAME}" --with-registry-auth
else
Expand Down