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