-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9056792
commit aaa56c2
Showing
1 changed file
with
56 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
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: python -m pip list | ||
- run: cd /root && pipenv run python -m pip install requests requests_iap scrapy algoliasearch selenium && 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 |