Skip to content

test main

test main #3

name: Jekyll Production Publishing
on:
push:
# branches:
# - 2.18
# - 2.17
# - 1.3
workflow_dispatch:
inputs:
manual_deploy_branch:
description: "Which branch do you want to manually deploy, use 'all' to deploy all the branches (1.3, 2.x, 3.x ...) from scratch, takes long time."
type: string
required: true
default: ''
env:
LATEST_VERSION: '2.18'
permissions:
contents: write
concurrency:
group: ${{ github.workflow }}-${{ github.event.inputs.manual_deploy_branch }}
cancel-in-progress: true
jobs:
jekyll-publish:
runs-on: ubuntu-latest
steps:
- name: echo concurrency group
run: echo ${{ github.workflow }}-${{ github.event.inputs.manual_deploy_branch }}
- uses: actions/checkout@v4
with:
path: docs
#- uses: ruby/setup-ruby@v1
# with:
# ruby-version: '3.2'
# bundler-cache: true
- name: Jekyll Build $GITHUB_REF_NAME
run: |
echo GITHUB_REF_NAME $GITHUB_REF_NAME
if [ "$GITHUB_REF_NAME" = "$LATEST_VERSION" ]; then
SITE_DIR="$PWD/site/latest"
else
SITE_DIR="$PWD/site/$GITHUB_REF_NAME"
fi
mkdir -p $SITE_DIR
cd docs
CURRENT_VERSION=$(jq -r '.current' _data/versions.json)
DESTINATION_KEY="/$CURRENT_VERSION"
sed -i -e "s|baseurl:.*$|baseurl:\ \"$DESTINATION_KEY\"|g" _config.yml
curl -s -f -o _data/alert.yml https://raw.githubusercontent.com/opensearch-project/project-website/prod/_data/alert.yml || rm -rf _data/alert.yml
bundle exec jekyll build --trace
touch .nojekyll _site
cp -a _site/* $SITE_DIR/
- name: Deploy GitHub Pages
uses: JamesIves/github-pages-deploy-action@releases/v4
with:
branch: gh-pages
folder: site