From 10b4e608bb1fe8b5b0166f075950ff54bbc2287c Mon Sep 17 00:00:00 2001 From: nemanjam Date: Fri, 7 Jun 2024 21:06:55 +0200 Subject: [PATCH] add ssh alias env var --- .github/workflows/bash__deploy-docker.yml | 3 ++- .github/workflows/bash__deploy-nginx.yml | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/bash__deploy-docker.yml b/.github/workflows/bash__deploy-docker.yml index ce49977..63751fd 100644 --- a/.github/workflows/bash__deploy-docker.yml +++ b/.github/workflows/bash__deploy-docker.yml @@ -9,6 +9,7 @@ on: workflow_dispatch: env: + SSH_ALIAS: arm1 IMAGE_NAME_WITH_TAG: ${{ secrets.DOCKER_USERNAME }}/${{ github.event.repository.name }}:latest jobs: @@ -36,7 +37,7 @@ jobs: chmod 600 ~/.ssh/id_ed25519 # Set up SSH config - echo "Host arm1" > ~/.ssh/config + echo "Host $SSH_ALIAS" > ~/.ssh/config echo " HostName ${{ secrets.REMOTE_HOST }}" >> ~/.ssh/config echo " User ${{ secrets.REMOTE_USERNAME }}" >> ~/.ssh/config echo " IdentityFile ~/.ssh/id_ed25519" >> ~/.ssh/config diff --git a/.github/workflows/bash__deploy-nginx.yml b/.github/workflows/bash__deploy-nginx.yml index dd6c4b7..733a1e1 100644 --- a/.github/workflows/bash__deploy-nginx.yml +++ b/.github/workflows/bash__deploy-nginx.yml @@ -13,6 +13,7 @@ on: env: SITE_URL: 'https://nemanjamitic.com' + SSH_ALIAS: arm1 jobs: deploy: @@ -49,7 +50,7 @@ jobs: chmod 600 ~/.ssh/id_ed25519 # Set up SSH config - echo "Host arm1" > ~/.ssh/config + echo "Host $SSH_ALIAS" > ~/.ssh/config echo " HostName ${{ secrets.REMOTE_HOST }}" >> ~/.ssh/config echo " User ${{ secrets.REMOTE_USERNAME }}" >> ~/.ssh/config echo " IdentityFile ~/.ssh/id_ed25519" >> ~/.ssh/config