Automate update site-search-data.json #53
Workflow file for this run
This file contains hidden or 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: Build Search Indicies | |
| on: | |
| push: | |
| branches: | |
| - libpitt/143-gha | |
| # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | |
| permissions: | |
| contents: write | |
| # Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. | |
| # However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. | |
| concurrency: | |
| group: "pages" | |
| cancel-in-progress: false | |
| jobs: | |
| buildSearch: | |
| runs-on: ubuntu-latest | |
| if: ${{ ! contains(github.event.head_commit.message, 'Automate update') }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| # Uses the private access token from above link | |
| with: | |
| fetch-depth: 0 | |
| token: ${{ secrets.GH_SUBMODULE_SECRET }} | |
| - name: Print the actors name | |
| run: echo "The workflow was initiated by ${{ github.actor }}" | |
| - name: Restore Timestamps | |
| uses: chetan/git-restore-mtime-action@v1 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build search | |
| run: npm run search | |
| - name: Commit & push changes | |
| run: | | |
| git config --global user.email "actions@github.com" | |
| git config --global user.name "GitHub Actions - build search index" | |
| git status | |
| git add . | |
| git commit -m "Automate update site-search-data.json" | |
| git push origin libpitt/143-gha |