Skip to content

Commit

Permalink
make env file path absolute
Browse files Browse the repository at this point in the history
  • Loading branch information
frankinspace committed Jun 18, 2024
1 parent d35620b commit a2b6beb
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/deploy-on-runner.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"

0 comments on commit a2b6beb

Please sign in to comment.