Update Algolia index #324
Workflow file for this run
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: Update Algolia index | |
on: | |
workflow_call: | |
workflow_dispatch: | |
schedule: | |
- cron: "0 3 * * *" # every day, 3am | |
env: | |
MIX_ENV: dev | |
USE_SERVER_SENT_EVENTS: "false" | |
V3_URL: ${{ secrets.V3_URL }} | |
V3_API_KEY: ${{ secrets.V3_API_KEY }} | |
WARM_CACHES: "false" | |
jobs: | |
algolia: | |
runs-on: ubuntu-latest | |
if: github.repository_owner == 'mbta' | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/cache/restore@v3 | |
with: | |
path: ~/.asdf | |
key: ci-asdf-cache-${{ hashFiles('.tool-versions') }} | |
restore-keys: ci-asdf-cache- | |
- uses: mbta/actions/reshim-asdf@v2 | |
- uses: actions/cache/restore@v3 | |
with: | |
path: deps | |
key: ci-mix-cache-${{ hashFiles('**/mix.lock') }} | |
restore-keys: ci-mix-cache- | |
# the running application runs Webpack to render React stuff :(, so need NPM too | |
- uses: actions/cache/restore@v3 | |
with: | |
path: apps/site/assets/node_modules | |
key: ci-nodejs-cache-${{ hashFiles('apps/site/assets/package-lock.json') }} | |
restore-keys: ci-nodejs-cache- | |
- env: | |
ALGOLIA_APP_ID: ${{ secrets.ALGOLIA_APP_ID }} | |
ALGOLIA_WRITE_KEY: ${{ secrets.ALGOLIA_WRITE_KEY }} | |
run: mix algolia.update |