Add Workflow and update cli documentation #833
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: Build and Test docs | |
on: | |
push: | |
tags: | |
- "*" | |
paths: | |
- ".github/workflows/docs-check.yml" | |
- "docs/**" | |
- "cli/**" | |
workflow_dispatch: | |
pull_request: | |
paths: | |
- ".github/workflows/docs-check.yml" | |
- "docs/**" | |
- "cli/**" | |
env: | |
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} | |
NETLIFY_SITE_ID: 23baf08e-2d3e-44db-8bd4-938e54467a29 | |
jobs: | |
# If changes are made inside the cli directory, generate the cli docs | |
generate: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Check for changes in cli directory | |
id: check_changes | |
run: | | |
if git diff --name-only ${{ github.event.before }} ${{ github.sha }} | grep -qE '^cli/'; then | |
echo "::set-output name=cli::true" | |
else | |
echo "::set-output name=cli::false" | |
fi | |
# Build the docs | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up NodeJS | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: Build docs | |
run: |- | |
npm install -w docs | |
npm run build -w docs | |
# https://typicode.github.io/husky/how-to.html#ci-server-and-docker | |
env: | |
HUSKY: 0 | |
- name: Deploy Docs to Netlify docs.rilldata.com | |
uses: nwtgck/[email protected] | |
if: github.event_name != 'pull_request' | |
with: | |
publish-dir: ./docs/dist | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
deploy-message: "Docs ${{ github.ref_name }} deployed to docs.rilldata.com" | |
production-deploy: true | |
enable-pull-request-comment: false | |
enable-commit-comment: true | |
overwrites-pull-request-comment: true | |
timeout-minutes: 1 | |
- name: Algolia crawler creation and crawl | |
uses: algolia/[email protected] | |
id: algolia_crawler | |
if: github.event_name != 'pull_request' | |
with: | |
crawler-name: rilldata | |
crawler-user-id: ${{ secrets.CRAWLER_USER_ID }} | |
crawler-api-key: ${{ secrets.CRAWLER_API_KEY }} | |
algolia-app-id: ${{ secrets.ALGOLIA_APP_ID }} | |
algolia-api-key: ${{ secrets.ALGOLIA_API_KEY }} | |
site-url: 'https://docs.rilldata.com' |