From 1943a6ff602d2ee93323e669fe339b6a431cd521 Mon Sep 17 00:00:00 2001 From: aradhanas9 <147805399+aradhanas9@users.noreply.github.com> Date: Thu, 6 Jun 2024 12:01:08 +0530 Subject: [PATCH] Update doc.nuxeo.com.yml --- .github/workflows/doc.nuxeo.com.yml | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/.github/workflows/doc.nuxeo.com.yml b/.github/workflows/doc.nuxeo.com.yml index 358de86b..05e43c6a 100644 --- a/.github/workflows/doc.nuxeo.com.yml +++ b/.github/workflows/doc.nuxeo.com.yml @@ -13,10 +13,21 @@ jobs: environment: name: ${{ github.ref_name == 'master' && 'production' || 'development' }} steps: - - name: Set up SSH - uses: webfactory/ssh-agent@d4b9b8ff72958532804b70bbe600ad43b36d5f2e # v0.8.0 + - name: Install SSH key for Bastion + uses: shimataro/ssh-key-action@v2 with: - ssh-private-key: ${{ secrets.SERVER_SSH_PRIVATE_KEY }} + key: ${{ secrets.DEV_TOOLS_BASTION_PRIVATE_KEY }} + name: id_rsa-bastion + known_hosts: ${{ secrets.KNOWN_HOSTS_OF_BASTION }} + config: ${{ secrets.CONFIG }} + + - name: Install SSH key of target + uses: shimataro/ssh-key-action@v2 + with: + key: ${{ secrets.DEV_TOOLS_EC2_PRIVATE_KEY }} + name: id_rsa-target + known_hosts: ${{ secrets.KNOWN_HOSTS_OF_TARGET }} + config: ${{ secrets.CONFIG }} - name: Checkout code uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 @@ -49,14 +60,13 @@ jobs: - name: Deploy to Server run: | - rsync -Wxvuk --delete site/ "${{ secrets.SERVER_USERNAME }}@${{ secrets.SERVER_IP }}:/opt/www/doc/" - rsync redirects.txt "${{ secrets.SERVER_USERNAME }}@${{ secrets.SERVER_IP }}:/etc/nginx/redirects.txt" - rsync redirects_pageid.txt ${{ secrets.SERVER_USERNAME }}@${{ secrets.SERVER_IP }}:/etc/nginx/redirects_pageid.txt + rsync -Wxvurk --delete site/ "ssh -o StrictHostKeyChecking=no" -vz lethe.nuxeo.com:"/opt/www/doc/" + rsync redirects.txt "ssh -o StrictHostKeyChecking=no" -vz lethe.nuxeo.com:"/etc/apache2/redirects.txt" + rsync redirects_pageid.txt "ssh -o StrictHostKeyChecking=no" -vz lethe.nuxeo.com:"/etc/apache2/redirects_pageid.txt" - - name: Nginx Config Test and Restart + - name: Apache Config Test and Restart run: | - ssh "${{ secrets.SERVER_USERNAME }}@${{ secrets.SERVER_IP }}" \ - "service nginx configtest && service nginx restart" + ssh -o StrictHostKeyChecking=no -T lethe.nuxeo.com "apache2ctl configtest && service apache2 restart" - name: Archive Artifacts uses: actions/upload-artifact@v3