Merge pull request #9002 from ballerina-platform/release-2201.9.0 #137
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Push changes of new search index | |
on: | |
push: | |
branches: | |
- master | |
paths: | |
- '_data/stable-latest/**' | |
- '_data/swanlake-latest/**' | |
jobs: | |
search-index-gen: | |
runs-on: ubuntu-latest | |
env: | |
GITHUB_TOKEN: ${{secrets.WEBSITE_TOKEN}} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
with: | |
token: ${{ secrets.WEBSITE_TOKEN }} | |
- name: Use Node.js | |
uses: actions/setup-node@v1 | |
with: | |
node-version: '8.x' | |
- name: Install node module cheerio | |
run: npm install cheerio | |
- name: Remove unwanted folders from the build | |
run: | | |
echo | pwd | |
rm -r 0.990/ 1.0/ 1.1/ | |
- name: Build the site | |
uses: shafreenAnfar/jekyll-build-action@v5 | |
- name: Copy search index tool | |
run: cp .github/scripts/search_index_generator.js . | |
- name: Run search generator | |
run: node search_index_generator.js | |
- name: Copy output to js directory | |
run: cp ./searchIndex.js js/ | |
- name: Commit changes for new search index | |
run: | | |
git pull origin master | |
git config --global user.email "ballerina-bot@ballerina.org" | |
git config --global user.name "ballerina-bot" | |
git add js/searchIndex.js | |
git commit --allow-empty -m '[Automated] Update search index' | |
- name: Push changes for new search index | |
shell: bash | |
run: | | |
curl -fsSL https://github.com/github/hub/raw/master/script/get | bash -s 2.14.1 | |
bin/hub push | |
env: | |
GITHUB_TOKEN: ${{ secrets.WEBSITE_TOKEN }} |