Skip to content

Commit 47cfe7c

Browse files
committed
.github/workflows: Use separate SSH config for deploy job
Signed-off-by: Pawel Langowski <pawel.langowski@3mdeb.com>
1 parent 80bc82c commit 47cfe7c

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

.github/workflows/ci.yml

+2-5
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,11 @@ jobs:
5757
chmod 600 ~/.ssh/dts-ci-key
5858
echo -e ${SSH_KEY_GITEA} > ~/.ssh/gitea-key
5959
chmod 600 ~/.ssh/gitea-key
60-
cp ~/.ssh/config ~/.ssh/config-old
6160
echo -e "\n
6261
Host git.3mdeb.com\n
6362
HostName git.3mdeb.com\n
6463
IdentityFile ~/.ssh/gitea-key\n
65-
IdentitiesOnly yes" >> ~/.ssh/config
64+
IdentitiesOnly yes" > ~/.ssh/config_deploy
6665
- name: Get DTS version
6766
id: dts-ver
6867
shell: bash
@@ -117,7 +116,7 @@ jobs:
117116
shell: bash
118117
run: |
119118
DTS_VER="${{steps.dts-ver.outputs.DTS_VER}}"
120-
git clone ssh://git@git.3mdeb.com:2222/3mdeb/dts-release-cicd-pipeline.git
119+
GIT_SSH_COMMAND='ssh -F ~/.ssh/config_deploy' git clone ssh://git@git.3mdeb.com:2222/3mdeb/dts-release-cicd-pipeline.git
121120
cd dts-release-cicd-pipeline
122121
echo ${DTS_VER} > LATEST_RELEASE
123122
git add LATEST_RELEASE
@@ -140,5 +139,3 @@ jobs:
140139
rm -rf dts-release-cicd-pipeline
141140
rm -f ~/.ssh/gitea-key
142141
rm -rf build
143-
rm -f ~/.ssh/config
144-
mv ~/.ssh/config-old ~/.ssh/config

.github/workflows/develop.yml

+2-5
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,11 @@ jobs:
5656
chmod 600 ~/.ssh/dts-ci-key
5757
echo -e ${SSH_KEY_GITEA} > ~/.ssh/gitea-key
5858
chmod 600 ~/.ssh/gitea-key
59-
cp ~/.ssh/config ~/.ssh/config-old
6059
echo -e "\n
6160
Host git.3mdeb.com\n
6261
HostName git.3mdeb.com\n
6362
IdentityFile ~/.ssh/gitea-key\n
64-
IdentitiesOnly yes" >> ~/.ssh/config
63+
IdentitiesOnly yes" > ~/.ssh/config_deploy
6564
- name: Get DTS version
6665
id: dts-ver
6766
shell: bash
@@ -108,7 +107,7 @@ jobs:
108107
shell: bash
109108
run: |
110109
DTS_VER="${{steps.dts-ver.outputs.DTS_VER}}"
111-
git clone ssh://git@git.3mdeb.com:2222/3mdeb/dts-release-cicd-pipeline.git
110+
GIT_SSH_COMMAND='ssh -F ~/.ssh/config_deploy' git clone ssh://git@git.3mdeb.com:2222/3mdeb/dts-release-cicd-pipeline.git
112111
cd dts-release-cicd-pipeline
113112
echo ${DTS_VER} > LATEST_RELEASE
114113
git add LATEST_RELEASE
@@ -131,5 +130,3 @@ jobs:
131130
rm -rf dts-release-cicd-pipeline
132131
rm -f ~/.ssh/gitea-key
133132
rm -rf build
134-
rm -f ~/.ssh/config
135-
mv ~/.ssh/config-old ~/.ssh/config

0 commit comments

Comments
 (0)