diff --git a/.github/workflows/publish_site.yml b/.github/workflows/publish_site.yml index 04e29d5fc32..525a95e3001 100644 --- a/.github/workflows/publish_site.yml +++ b/.github/workflows/publish_site.yml @@ -25,6 +25,8 @@ jobs: build: needs: setup runs-on: ubuntu-latest + outputs: + website_version: ${{ steps.set_output.outputs.website_version }} steps: - uses: actions/checkout@v4 - uses: ruby/setup-ruby@v1 @@ -35,6 +37,7 @@ jobs: run: | 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:]') + echo "::set-output name=website_version::$WEBSITE_VERSION" sed -i '/^baseurl:/c\baseurl: "/docs/'"$WEBSITE_VERSION"'"' _config.yml cat _config.yml|grep -e "^url:" -e "^baseurl:" - run: bundle exec jekyll build --future @@ -46,7 +49,7 @@ jobs: deploy: needs: build - runs-on: ubuntu-latest + runs-on: ubuntu-latest if: github.event_name != 'pull_request' steps: - uses: actions/download-artifact@v4 @@ -64,14 +67,13 @@ 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/$WEBSITE_VERSION; mirror --reverse --parallel=20 --verbose _site/ /var/www/${{ env.WEBSITE_URL }}/html/$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/${{ needs.job1.outputs.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 runs-on: ubuntu-latest - if: github.event_name != 'pull_request' + if: github.event_name != ' pull_request' steps: - name: Purge Cloudflare Cache run: |