Update DataOps browser application bundles #48
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: Validate DataOps Content | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - "content/**" | |
| - "templates/dataops-knowledge/**" | |
| - "_docs/**" | |
| - "docs/**" | |
| - ".goal-v1.md" | |
| - "PROJECT_PLAN.md" | |
| - "PORTAL_ANALYSIS.md" | |
| - "README.md" | |
| - "backend/scripts/seed-templates.ts" | |
| - "tools/content_tools/**" | |
| - ".github/workflows/validate-dataops-content.yml" | |
| pull_request: | |
| paths: | |
| - "content/**" | |
| - "templates/dataops-knowledge/**" | |
| - "_docs/**" | |
| - "docs/**" | |
| - ".goal-v1.md" | |
| - "PROJECT_PLAN.md" | |
| - "PORTAL_ANALYSIS.md" | |
| - "README.md" | |
| - "backend/scripts/seed-templates.ts" | |
| - "tools/content_tools/**" | |
| - ".github/workflows/validate-dataops-content.yml" | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| id-token: write | |
| env: | |
| AWS_REGION: eu-west-1 | |
| AWS_DEFAULT_REGION: eu-west-1 | |
| AWS_ROLE_ARN: arn:aws:iam::817685572750:role/dataops-github-actions-deploy | |
| FULL_DOCS_STACK_NAME: dataops-v1 | |
| jobs: | |
| validate-content: | |
| name: Validate operation docs content | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v8.1.0 | |
| - name: Install Python | |
| run: uv python install | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: "20" | |
| cache: npm | |
| cache-dependency-path: package-lock.json | |
| - name: Validate docs links and workflow doc IDs | |
| run: uv run --project tools/content_tools python -m content_tools.validate_docs_links --repo-root . --content-root content | |
| - name: Validate dataops-knowledge migration scaffold | |
| run: uv run --project tools/content_tools python -m content_tools.validate_knowledge_repo --repo-root . --scaffold-root templates/dataops-knowledge | |
| - name: Install Node workspace dependencies | |
| run: npm ci | |
| - name: Build search index | |
| run: | | |
| mkdir -p .tmp | |
| npm --prefix backend run build:search-index -- --content-dir ../content --output ../.tmp/dataops-content-search.index | |
| - name: Smoke test built index | |
| working-directory: backend | |
| run: npx tsx scripts/smoke-search-index.ts ../.tmp/dataops-content-search.index | |
| - name: Check whether content changed | |
| if: github.event_name == 'push' | |
| id: content-changes | |
| run: | | |
| if git diff --name-only "${{ github.event.before }}" "${{ github.sha }}" | grep -q '^content/'; then | |
| echo "changed=true" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "changed=false" >> "$GITHUB_OUTPUT" | |
| echo "No content files changed; skipping deployed cache refresh." | |
| fi | |
| - name: Configure AWS credentials | |
| if: github.event_name == 'push' && steps.content-changes.outputs.changed == 'true' | |
| uses: aws-actions/configure-aws-credentials@v6.1.0 | |
| with: | |
| role-to-assume: ${{ env.AWS_ROLE_ARN }} | |
| role-session-name: dataops-content-refresh | |
| aws-region: ${{ env.AWS_REGION }} | |
| - name: Refresh deployed docs cache | |
| if: github.event_name == 'push' && steps.content-changes.outputs.changed == 'true' | |
| run: | | |
| function_name="$( | |
| aws cloudformation describe-stack-resource \ | |
| --stack-name "$FULL_DOCS_STACK_NAME" \ | |
| --logical-resource-id BackendFunction \ | |
| --region "$AWS_REGION" \ | |
| --query 'StackResourceDetail.PhysicalResourceId' \ | |
| --output text | |
| )" | |
| printf '%s' '{"source":"dataops.github-actions","rawPath":"/admin/refresh","requestContext":{"http":{"method":"POST"}}}' > /tmp/dataops-refresh-event.json | |
| aws lambda invoke \ | |
| --function-name "$function_name" \ | |
| --region "$AWS_REGION" \ | |
| --cli-binary-format raw-in-base64-out \ | |
| --payload file:///tmp/dataops-refresh-event.json \ | |
| /tmp/dataops-refresh-response.json | |
| python3 - <<'PY' | |
| import json | |
| from pathlib import Path | |
| payload = json.loads(Path("/tmp/dataops-refresh-response.json").read_text()) | |
| assert payload["statusCode"] == 200, payload | |
| body = json.loads(payload["body"]) | |
| assert body.get("ok") is True and body.get("refreshed") is True, body | |
| print(f"Refreshed deployed docs cache on {body.get('branch')}") | |
| PY |