Skip to content

Commit

Permalink
Create workflow for algolia
Browse files Browse the repository at this point in the history
  • Loading branch information
sabicalija committed Jan 26, 2023
1 parent 9056792 commit a0e6d8f
Showing 1 changed file with 55 additions and 0 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/algolia.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Algolia
on:
workflow_call:
workflow_dispatch:

jobs:
config:
runs-on: ubuntu-latest
outputs:
CONFIG: ${{ steps.load.outputs.config }}
steps:
- name: Get Code
uses: actions/checkout@v3
- name: Prepare config file
run: echo "$(cat ./src/vuepress/config/algolia.json | jq -r tostring)" > config.json
- name: Set output variable
id: load
run: echo "config=$(cat config.json)" >> $GITHUB_OUTPUT
crawl:
runs-on: ubuntu-latest
container: algolia/docsearch-scraper
needs: config
env:
CONFIG: ${{ needs.config.outputs.CONFIG }}
APPLICATION_ID: ${{ secrets.APPLICATION_ID }}
API_KEY: ${{ secrets.API_KEY }}
steps:
- run: echo "config ${CONFIG}"
- run: echo "appId ${APPLICATION_ID}"
- run: ls
- run: pwd
- run: ls /root
- run: ls /root/src
- run: cd /root && pipenv run python -m pip install requests requests_iap scrapy algoliasearch && pipenv run python -m src.index
# runs-on: ubuntu-latest
# env:
# APPLICATION_ID: ${{ secrets.APPLICATION_ID }}
# API_KEY: ${{ secrets.API_KEY }}
# # container:
# # algolia/docsearch-scraper
# steps:
# - name: Get Code
# uses: actions/checkout@v3
# - name: Prepare config file
# run: echo "$(cat ./src/vuepress/config/algolia.json | jq -r tostring)" > config.json
# - name: Set environment variable
# run: echo "CONFIG=$(cat config.json)" >> $GITHUB_ENV
# # run: echo "::set-env name=CONFIG::$(cat config.json)"
# # - name: Run in Docker
# # run:
# # - name: Crawl website and update index
# # run: docker run -e "CONFIG=$(cat ./src/vuepress/config/algolia.json | jq -r tostring)" algolia/docsearch-scraper
# - run: echo $CONFIG
# - name: Crawl website and update index
# run: docker run --env-file <(env | grep -E "(CONFIG|APPLICATION\_ID|API\_KEY)") algolia/docsearch-scraper

0 comments on commit a0e6d8f

Please sign in to comment.