Skip to content

Commit

Permalink
Add more
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Zhu <zhujiaxi@amazon.com>
  • Loading branch information
peterzhuamazon committed Jan 16, 2025
1 parent ff01a54 commit 623c055
Showing 1 changed file with 18 additions and 17 deletions.
35 changes: 18 additions & 17 deletions .github/workflows/jekyll-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,42 +17,43 @@ env:
SITE_URL: https://docsstaging.opensearch.net

concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
group: ${{ github.workflow }}-${{ github.event.inputs.manual_deploy_branch || github.ref_name }}
cancel-in-progress: true

jobs:
jekyll-deploy:
runs-on: ubuntu-latest

steps:
- name: echo concurrency group
run: echo ${{ github.workflow }}-${{ github.ref_name }}
- name: echo deploy branch
run: echo ${{ github.ref_name }}
- name: Set variables
run: |
deploy_branch=${{ github.event.inputs.manual_deploy_branch || github.ref_name }}
echo "DEPLOY_BRANCH=$deploy_branch" >> $GITHUB_ENV
echo DEPLOY_BRANCH $DEPLOY_BRANCH
echo concurrent group ${{ github.workflow }}-$DEPLOY_BRANCH
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.2'
bundler-cache: true
- name: Jekyll Build ${{ github.ref_name }}
- name: Jekyll Build ${{ env.DEPLOY_BRANCH }}
run: |
echo ${{ github.event.inputs.manual_deploy_branch }}
echo GITHUB_REF_NAME ${{ github.ref_name }}
LATEST_VERSION=$(jq -r '.current' _data/versions.json)
echo LATEST_VERSION $LATEST_VERSION
if [ "${{ github.ref_name }}" = "$LATEST_VERSION" ]; then
DESTINATION_KEY="latest"
elif [ "${{ github.ref_name }}" = ${{ github.event.repository.default_branch }} ]; then
#DESTINATION_KEY="staging"
DESTINATION_KEY="latest"
if [ "$DEPLOY_BRANCH" = "$LATEST_VERSION" ]; then
destination_key="latest"
elif [ "$DEPLOY_BRANCH" = ${{ github.event.repository.default_branch }} ]; then
#destination_key="staging"
destination_key="latest"
else
DESTINATION_KEY="${{ github.ref_name }}"
destination_key="$DEPLOY_BRANCH"
fi
echo "DESTINATION_KEY_ENV=$DESTINATION_KEY" >> $GITHUB_ENV
echo ${{ env.DESTINATION_KEY_ENV }}
echo "DESTINATION_KEY=$destination_key" >> $GITHUB_ENV
echo DESTINATION_KEY $DESTINATION_KEY
bundle install
CURRENT_VERSION=$(jq -r '.current' _data/versions.json)
sed -i -e "s|^url:.*$|url:\ \"$SITE_URL\"|g" _config.yml
Expand All @@ -68,4 +69,4 @@ jobs:
branch: gh-pages
folder: _site
clean: true
target-folder: docs/${{ env.DESTINATION_KEY_ENV }}
target-folder: docs/${{ env.DESTINATION_KEY }}

0 comments on commit 623c055

Please sign in to comment.