From f7a5de346bd3c3d00bf286be9250ef2a46250fa4 Mon Sep 17 00:00:00 2001 From: Piotr Chmielnik Date: Fri, 23 Feb 2024 20:30:21 +0100 Subject: [PATCH] Fix broken links --- .github/workflows/publish_site.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/publish_site.yml b/.github/workflows/publish_site.yml index cb5f8d12707..693a712bb99 100644 --- a/.github/workflows/publish_site.yml +++ b/.github/workflows/publish_site.yml @@ -34,8 +34,9 @@ jobs: bundler-cache: true - name: Update _config.yml run: | - sed -i '/^url:/c\url: "https://${{ env.WEBSITE_URL }}"' _config.yml - sed -i '/^baseurl:/c\baseurl: "/docs/${{ env.WEBSITE_VERSION }}"' _config.yml + sed -i '/^url:/c\url: "https://${{ env.WEBSITE_URL }}"' _config.yml + WEBSITE_VERSION=$(cat _config.yml|grep "^opensearch_major_minor_version:"|cut -d ':' -f2| tr -d '[:blank:]') + sed -i '/^baseurl:/c\baseurl: "/docs/$WEBSITE_VERSION"' _config.yml cat _config.yml|grep -e "^url:" -e "^baseurl:" - run: bundle exec jekyll build --future - uses: actions/upload-artifact@v4 @@ -64,8 +65,9 @@ jobs: run: | sudo apt install lftp -y lftp --version + WEBSITE_VERSION=$(cat _site/_config.yml|grep "^opensearch_major_minor_version:"|cut -d ':' -f2| tr -d '[:blank:]') echo "Start SFTP upload" - lftp -u ${{ secrets.SFTP_USERNAME }}, -e "set sftp:connect-program 'ssh -a -x -o StrictHostKeyChecking=no'; mkdir -p /var/www/${{ env.WEBSITE_URL }}/html/${{ env.WEBSITE_VERSION }}; mirror --reverse --parallel=20 --verbose _site/ /var/www/${{ env.WEBSITE_URL }}/html/${{ env.WEBSITE_VERSION }}/; quit" sftp://${{ secrets.SFTP_SERVER }} + lftp -u ${{ secrets.SFTP_USERNAME }}, -e "set sftp:connect-program 'ssh -a -x -o StrictHostKeyChecking=no'; mkdir -p /var/www/${{ env.WEBSITE_URL }}/html/${{ env.WEBSITE_VERSION }}; mirror --reverse --parallel=20 --verbose _site/ /var/www/${{ env.WEBSITE_URL }}/html/$WEBSITE_VERSION/; quit" sftp://${{ secrets.SFTP_SERVER }} post_deploy: needs: deploy