From 1285693ac822ebc44ef31282d9cc04eec60eba1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leonardo=20Mur=C3=A7a?= Date: Tue, 1 Nov 2022 11:41:53 -0300 Subject: [PATCH] Pass SSH_KEY as parameter --- .github/workflows/deploy-dev.yml | 2 +- .github/workflows/deploy-prod.yml | 2 +- scripts/deploy.sh | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/deploy-dev.yml b/.github/workflows/deploy-dev.yml index ff5f7d6..2d61d35 100644 --- a/.github/workflows/deploy-dev.yml +++ b/.github/workflows/deploy-dev.yml @@ -21,4 +21,4 @@ jobs: cache: 'npm' - run: npm install - run: npm run build:dev - - run: sh ${GITHUB_WORKSPACE}/scripts/deploy.sh dev + - run: sh ${GITHUB_WORKSPACE}/scripts/deploy.sh $SSH_KEY dev diff --git a/.github/workflows/deploy-prod.yml b/.github/workflows/deploy-prod.yml index 952eefd..6aaf6c1 100644 --- a/.github/workflows/deploy-prod.yml +++ b/.github/workflows/deploy-prod.yml @@ -21,4 +21,4 @@ jobs: cache: 'npm' - run: npm install - run: npm run build:prod - - run: sh ${GITHUB_WORKSPACE}/scripts/deploy.sh prod + - run: sh ${GITHUB_WORKSPACE}/scripts/deploy.sh $SSH_KEY prod diff --git a/scripts/deploy.sh b/scripts/deploy.sh index d61b7f0..6293116 100644 --- a/scripts/deploy.sh +++ b/scripts/deploy.sh @@ -1,7 +1,7 @@ #!/bin/sh mkdir ~/.ssh && -echo "$SSH_KEY" >> ~/.ssh/id_rsa_ifsalas && +echo "$1" >> ~/.ssh/id_rsa_ifsalas && chmod 400 ~/.ssh/id_rsa_ifsalas && echo -e "Host ifsalas\n\tUser ifsalas\n\tHostname 45.76.5.44\n\tIdentityFile ~/.ssh/id_rsa_ifsalas\n\tStrictHostKeyChecking No" >> ~/.ssh/config && -rsync -avz --progress build/ ifsalas:/home/ifsalas/web/$1 --delete +rsync -avz --progress build/ ifsalas:/home/ifsalas/web/$2 --delete