Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: 🤖 TIAS scraper via container #13

Draft
wants to merge 8 commits into
base: develop
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 43 additions & 25 deletions .github/workflows/deploy-gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,42 +4,60 @@ on:
push:
branches:
- main
- chore/scraper-in-docker-version

workflow_dispatch:

jobs:
deploy:
name: Deploy
# deploy:
# name: Deploy
# runs-on: ubuntu-latest
# env:
# PAT: ${{ secrets.PAT }}

# steps:
# - uses: actions/checkout@v3
# - uses: actions/setup-node@v3
# with:
# node-version: 18
# cache: yarn

# - name: Install dependencies
# run: yarn install --frozen-lockfile
# - name: Build website
# run: yarn build

# - name: Deploy to GitHub Pages
# uses: peaceiris/actions-gh-pages@v3
# with:
# github_token: ${{ secrets.GITHUB_TOKEN }}
# publish_dir: ./build
# # https://github.com/actions/checkout/issues/13#issuecomment-724415212
# user_name: github-actions[bot]
# user_email: 41898282+github-actions[bot]@users.noreply.github.com

docsearch-scraper:
runs-on: ubuntu-latest
container:
image: algolia/docsearch-scraper
env:
PAT: ${{ secrets.PAT }}
ALGOLIA_APP_ID: ${{ secrets.ALGOLIA_APP_ID }}
ALGOLIA_API_KEY: ${{ secrets.ALGOLIA_API_KEY }}

steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- name: Install jq
uses: dcarbone/install-jq-action@v1.0.1
with:
node-version: 18
cache: yarn
version: 1.6
- name: config.docsearch.json as config
id: algolia_config
run: echo "::set-output name=config::$(cat config.docsearch.json | jq -r tostring)"

- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Build website
run: yarn build

- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./build
# https://github.com/actions/checkout/issues/13#issuecomment-724415212
user_name: github-actions[bot]
user_email: 41898282+github-actions[bot]@users.noreply.github.com

- name: Algolia docsearch indexer
uses: darrenjennings/algolia-docsearch-action@master
with:
algolia_application_id: ${{env.ALGOLIA_APP_ID}}
algolia_api_key: ${{env.ALGOLIA_API_KEY}}
file: config.docsearch.json
- name: Push indices
uses: signcl/docsearch-scraper-action@master
env:
APPLICATION_ID: ${{ secrets.ALGOLIA_APP_ID }}
API_KEY: ${{ secrets.ALGOLIA_API_KEY }}
CONFIG: ${{ steps.algolia_config.outputs.config }}