Skip to content

Commit

Permalink
use name ssh key
Browse files Browse the repository at this point in the history
  • Loading branch information
frankinspace committed Jun 18, 2024
1 parent 0a5fbdc commit d35620b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,7 @@ jobs:
AWS_DEFAULT_REGION: us-west-2
API_IMAGE_NAME: ${{ env.GITLAB_CONTAINER_IMAGE_URI }}
API_MACHINE: ${{ secrets.API_MACHINE }}
API_MACHINE_KEYPATH: ${{ secrets.API_MACHINE_KEYPATH }}
run: |
echo "Deploy ${{ env.API_IMAGE_NAME }} to ${{ needs.build.outputs.deploy_env }}"
${GITHUB_WORKSPACE}/.github/workflows/deploy-on-runner.sh
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/deploy-on-runner.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
set -exo pipefail

# # Make sure to add the public key of the CI machine to the authorized keys of the api machine
ssh "${API_MACHINE}" "docker-compose -f docker-compose-maap-api.yml down"
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 -v docker-compose-maap-api.yml "${API_MACHINE}":~/
scp -v .maap-api.env "${API_MACHINE}":~/.maap-api.env
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

ssh "${API_MACHINE}" "docker-compose -f docker-compose-maap-api.yml pull"
ssh "${API_MACHINE}" "docker-compose -f docker-compose-maap-api.yml up -d"
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 d35620b

Please sign in to comment.