add tutorial on custom domain migration (#2647) #70
This file contains hidden or 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: Deploy Orama Search Index | |
on: | |
push: | |
branches: [main] | |
paths: | |
# Only trigger when documentation content changes | |
- "runtime/**/*.md" | |
- "deploy/**/*.md" | |
- "examples/**/*.md" | |
- "subhosting/**/*.md" | |
- "lint/**/*.md" | |
- "reference_gen/**" | |
# Or when the build configuration changes | |
- "deno.json" | |
- "orama/**" | |
# Allow manual triggering for testing | |
workflow_dispatch: | |
inputs: | |
force_deploy: | |
description: "Force deploy even without content changes" | |
required: false | |
default: false | |
type: boolean | |
jobs: | |
deploy-search-index: | |
name: Generate and Deploy Search Index | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
# Fetch more history for content change detection | |
fetch-depth: 2 | |
- name: Setup Deno | |
uses: denoland/setup-deno@v2 | |
with: | |
cache: true | |
- name: "Reference: install" | |
if: steps.changes.outputs.content_changed == 'true' | |
working-directory: "reference_gen" | |
run: deno install | |
- name: "Reference: generate types" | |
if: steps.changes.outputs.content_changed == 'true' | |
working-directory: "reference_gen" | |
run: deno task types | |
- name: "Reference: generate docs" | |
if: steps.changes.outputs.content_changed == 'true' | |
working-directory: "reference_gen" | |
run: deno task doc | |
- name: Check for content changes | |
id: changes | |
run: | | |
if [ "${{ github.event.inputs.force_deploy }}" = "true" ]; then | |
echo "Force deploy requested" | |
echo "content_changed=true" >> $GITHUB_OUTPUT | |
else | |
# Check if any content files changed in the last commit | |
CHANGED=$(git diff --name-only HEAD~1 HEAD | grep -E '\.(md|json)$|^reference_gen/|^orama/' || echo "") | |
if [ -n "$CHANGED" ]; then | |
echo "content_changed=true" >> $GITHUB_OUTPUT | |
echo "Content files changed:" | |
echo "$CHANGED" | sed 's/^/ /' | |
else | |
echo "content_changed=false" >> $GITHUB_OUTPUT | |
echo " No content changes detected - skipping search index update" | |
fi | |
fi | |
- name: Generate comprehensive search index | |
if: steps.changes.outputs.content_changed == 'true' | |
run: | | |
echo "Generating comprehensive Orama search index..." | |
deno task generate:search | |
- name: Upload and deploy to Orama Cloud | |
if: steps.changes.outputs.content_changed == 'true' | |
run: | | |
echo "Uploading search index to Orama Cloud..." | |
if [ -z "$ORAMA_PRIVATE_API_KEY" ] || [ -z "$ORAMA_PROJECT_ID" ] || [ -z "$ORAMA_DATASOURCE_ID" ]; then | |
echo "⚠️ Missing Orama Cloud credentials - skipping upload" | |
echo "This is expected for external contributors and forks" | |
exit 0 | |
fi | |
deno task search:upload | |
env: | |
ORAMA_PROJECT_ID: ${{ vars.ORAMA_PROJECT_ID }} | |
ORAMA_DATASOURCE_ID: ${{ vars.ORAMA_DATASOURCE_ID }} | |
ORAMA_PRIVATE_API_KEY: ${{ secrets.ORAMA_PRIVATE_API_KEY }} | |
- name: Report deployment status | |
if: steps.changes.outputs.content_changed == 'true' | |
run: | | |
if [ -n "$ORAMA_PRIVATE_API_KEY" ] && [ -n "$ORAMA_PROJECT_ID" ] && [ -n "$ORAMA_DATASOURCE_ID" ]; then | |
echo "✅ Search index deployment completed successfully!" | |
echo "Updated search includes:" | |
echo " 📄 Documentation pages" | |
echo " 🔧 API references (Deno, Web, Node.js)" | |
echo " 📊 Total searchable documents: ~5,856" | |
else | |
echo "⏭️ Search index upload was skipped (missing credentials)" | |
echo "📝 Generated search index files are available in the build artifacts" | |
echo "🔍 Search functionality will use the existing deployed index" | |
fi | |
env: | |
ORAMA_PROJECT_ID: ${{ vars.ORAMA_PROJECT_ID }} | |
ORAMA_DATASOURCE_ID: ${{ vars.ORAMA_DATASOURCE_ID }} | |
ORAMA_PRIVATE_API_KEY: ${{ secrets.ORAMA_PRIVATE_API_KEY }} | |
- name: Skip deployment message | |
if: steps.changes.outputs.content_changed == 'false' | |
run: | | |
echo "No content changes detected - search index deployment skipped" | |
echo "To force a deployment, use the 'workflow_dispatch' trigger with force_deploy=true" |