Skip to content

Commit

Permalink
Manual action
Browse files Browse the repository at this point in the history
  • Loading branch information
olivierapivideo committed Sep 3, 2024
1 parent 5f37e25 commit f41fa81
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .github/actions/update-algolia/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ try {
const algoliaAppId = process.env.ALGOLIA_APPLICATION_ID;
const algoliaApiKey = process.env.ALGOLIA_API_KEY;

console.log(process.env);

if (!algoliaIndex || !algoliaAppId || !algoliaApiKey) {
throw new Error("Missing Algolia configuration")
}
Expand Down
26 changes: 26 additions & 0 deletions .github/workflows/rebuild-algolia-index.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Rebuild Algolia index
on:
workflow_dispatch:
jobs:
update-algolia:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Node.js 16
uses: actions/setup-node@v2
with:
node-version: '16'

- name: Set environment variables from action inputs
shell: bash
run: |
echo "MODE=reindexation" >> $GITHUB_ENV
echo "ALGOLIA_INDEX=${{ secrets.ALGOLIA_INDEX }}" >> $GITHUB_ENV
echo "ALGOLIA_APPLICATION_ID=${{ secrets.ALGOLIA_APPLICATION_ID }}" >> $GITHUB_ENV
echo "ALGOLIA_API_KEY=${{ secrets.ALGOLIA_API_KEY }}" >> $GITHUB_ENV
- name: Rebuild Algolia index
shell: bash
run: node .github/actions/update-algolia/dist/index.js
1 change: 0 additions & 1 deletion .github/workflows/update-algolia.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ on:
push:
branches:
- main
workflow_dispatch:
jobs:
update-algolia:
runs-on: ubuntu-latest
Expand Down

0 comments on commit f41fa81

Please sign in to comment.