From a2b6beb756b496a022401416e05d8d2b23db2a1d Mon Sep 17 00:00:00 2001 From: Frank Greguska <89428916+frankinspace@users.noreply.github.com> Date: Tue, 18 Jun 2024 16:43:10 -0700 Subject: [PATCH] make env file path absolute --- .github/workflows/deploy-on-runner.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/deploy-on-runner.sh b/.github/workflows/deploy-on-runner.sh index 72f5235..a68cba6 100755 --- a/.github/workflows/deploy-on-runner.sh +++ b/.github/workflows/deploy-on-runner.sh @@ -2,12 +2,14 @@ set -exo pipefail +SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) + # # Make sure to add the public key of the CI machine to the authorized keys of the api machine ssh -i ${API_MACHINE_KEYPATH} "${API_MACHINE}" "docker-compose -f docker-compose-maap-api.yml down" # Copy new file after compose down on api machine -cat "${GITHUB_WORKSPACE}"/docker/docker-compose-maap-api.yml.tmpl | envsubst >> docker-compose-maap-api.yml -scp -i ${API_MACHINE_KEYPATH} -v docker-compose-maap-api.yml "${API_MACHINE}":~/ -scp -i ${API_MACHINE_KEYPATH} -v .maap-api.env "${API_MACHINE}":~/.maap-api.env +cat "${GITHUB_WORKSPACE}"/docker/docker-compose-maap-api.yml.tmpl | envsubst >> "${SCRIPT_DIR}/"docker-compose-maap-api.yml +scp -i ${API_MACHINE_KEYPATH} -v "${SCRIPT_DIR}/"docker-compose-maap-api.yml "${API_MACHINE}":~/ +scp -i ${API_MACHINE_KEYPATH} -v "${SCRIPT_DIR}/".maap-api.env "${API_MACHINE}":~/.maap-api.env ssh -i ${API_MACHINE_KEYPATH} "${API_MACHINE}" "docker-compose -f docker-compose-maap-api.yml pull" ssh -i ${API_MACHINE_KEYPATH} "${API_MACHINE}" "docker-compose -f docker-compose-maap-api.yml up -d"