Skip to content

Commit 97e8743

Browse files
authored
Merge pull request #15 from cuappdev/main
changed workflow file username
2 parents 4624e80 + 99957c2 commit 97e8743

1 file changed

Lines changed: 9 additions & 11 deletions

File tree

.github/workflows/deploy-prod.yml

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -38,26 +38,24 @@ jobs:
3838
env:
3939
PRIVATE_KEY: ${{ secrets.PROD_SERVER_KEY }}
4040
HOST: ${{ secrets.PROD_SERVER_HOST }}
41-
USER: ${{ secrets.SERVER_USERNAME }}
41+
REMOTE_USER: ${{ secrets.SERVER_USERNAME }}
4242
IMAGE_TAG: ${{ steps.vars.outputs.sha_short }}
4343
run: |
44-
# Setup SSH directory
4544
mkdir -p ~/.ssh
4645
chmod 700 ~/.ssh
47-
48-
# Save the Private Key to a file using the env var
49-
echo "$PRIVATE_KEY" > ~/.ssh/id_rsa
46+
47+
# Using printf instead of echo prevents newline formatting bugs
48+
printf "%s\n" "$PRIVATE_KEY" > ~/.ssh/id_rsa
5049
chmod 600 ~/.ssh/id_rsa
51-
52-
# Add the server to known_hosts to avoid prompt
50+
5351
ssh-keyscan -H "$HOST" >> ~/.ssh/known_hosts
54-
55-
# Run the remote commands
56-
ssh -i ~/.ssh/id_rsa "$USER@$HOST" "
52+
53+
# Added -v for debugging, -o for RSA support, and $REMOTE_USER
54+
ssh -v -o PubkeyAcceptedKeyTypes=+ssh-rsa -i ~/.ssh/id_rsa "$REMOTE_USER@$HOST" "
5755
export IMAGE_TAG=$IMAGE_TAG
5856
cd docker-compose
5957
docker stack rm thestack
6058
sleep 20
6159
docker stack deploy -c docker-compose.yml thestack
6260
docker system prune -af
63-
"
61+
"

0 commit comments

Comments
 (0)