Skip to content

Commit 5e2482e

Browse files
author
Layko Andrey
committed
CI/CD
1 parent aebbeb0 commit 5e2482e

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

.github/workflows/open-api-ci-cd.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ jobs:
240240
-e "EVENT_SUBSCRIPTION=true" \
241241
-e "WIDGET_HOST=${{ secrets.WIDGET_HOST_PROD }}" \
242242
-e "STATE_API_URL=${{ secrets.STATE_API_URL_PROD }}" \
243-
${{ env.DEPLOY_IMAGE_NAME }}}:${{ env.DEPLOY_IMAGE_TAG }}}
243+
${{ env.DEPLOY_IMAGE_NAME }}:${{ env.DEPLOY_IMAGE_TAG }}
244244
"
245245
246246
update-certificates-production:
@@ -253,18 +253,17 @@ jobs:
253253

254254
- name: Setup SSH connection
255255
run: |
256-
sudo apt install openssh-client
257-
sudo curl -L "https://github.com/docker/compose/releases/download/1.27.4/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
258256
eval $(ssh-agent -s)
257+
echo "${{ secrets.DEPLOY_KEY_PROD }}" > deploy_key
258+
chmod 600 ./deploy_key
259259
mkdir -p ~/.ssh
260260
chmod 700 ~/.ssh
261-
echo "${{ secrets.DEPLOY_KEY_PROD }}" | tr -d '\r' | ssh-add - > ~/.ssh/id_rsa
262261
ssh-keyscan ${{ secrets.DEPLOY_HOST_PROD }} >> ~/.ssh/known_hosts
263262
chmod 644 ~/.ssh/known_hosts
264263
265264
- name: Setup SSH connection
266265
run: |
267-
ssh ${{ secrets.DEPLOY_USER_PROD }}@${{ secrets.DEPLOY_HOST_PROD }} "
266+
ssh -i ./deploy_key ${{ secrets.DEPLOY_USER_PROD }}@${{ secrets.DEPLOY_HOST_PROD }} "
268267
docker run --rm --name certbot \
269268
-v /etc/letsencrypt:/etc/letsencrypt \
270269
-v /var/www/certbot:/var/www/certbot \
@@ -274,5 +273,5 @@ jobs:
274273
-d ${{ secrets.SERVER_NAME_PROD }} \
275274
--renew-by-default -m devops@zensoft.io --eff-email --agree-tos --manual-public-ip-logging-ok
276275
"
277-
ssh ${{ secrets.DEPLOY_USER_PROD }}@${{ secrets.DEPLOY_HOST_PROD }} "
276+
ssh -i ./deploy_key ${{ secrets.DEPLOY_USER_PROD }}@${{ secrets.DEPLOY_HOST_PROD }} "
278277
sudo service nginx reload"

0 commit comments

Comments
 (0)