1
0
mirror of synced 2025-12-19 18:14:56 -05:00

feat(bulk-cdk): Add Dokka documentation generation with Vercel deployment (#69752)

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
Aaron ("AJ") Steers
2025-11-21 09:30:17 -08:00
committed by GitHub
parent 1e5be9bb23
commit 130339b57f
4 changed files with 280 additions and 0 deletions

View File

@@ -0,0 +1,148 @@
name: Kotlin Bulk CDK Documentation
on:
pull_request:
types: [opened, synchronize, reopened]
paths:
- "airbyte-cdk/bulk/**"
push:
branches:
- master
paths:
- "airbyte-cdk/bulk/**"
workflow_dispatch:
# Concurrency group ensures only one deployment runs at a time
concurrency:
group: kotlin-bulk-cdk-docs-${{ github.ref }}
cancel-in-progress: false
jobs:
detect-changes:
name: Detect Kotlin Bulk CDK Changes
runs-on: ubuntu-24.04
steps:
- name: Detect Changes
id: detect-changes
uses: dorny/paths-filter@v3.0.2
with:
filters: |
bulk-cdk:
- 'airbyte-cdk/bulk/**'
outputs:
changed: ${{ steps.detect-changes.outputs.bulk-cdk }}
build-docs:
name: Build Kotlin Bulk CDK Documentation
runs-on: ubuntu-24.04
needs: detect-changes
if: needs.detect-changes.outputs.changed == 'true'
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
fetch-depth: 0
repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }}
ref: ${{ github.head_ref || github.ref }}
- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: "zulu"
java-version: "21"
- name: Setup Gradle
uses: gradle/gradle-build-action@v3
with:
gradle-version: wrapper
- name: Generate Dokka Documentation
run: |
echo "📚 Generating Dokka documentation for Kotlin Bulk CDK..."
./gradlew :airbyte-cdk:bulk:dokkaHtmlMultiModule --no-daemon
echo "✅ Documentation generated successfully"
ls -la airbyte-cdk/bulk/build/dokka/htmlMultiModule/
- name: Upload Documentation Artifact
uses: actions/upload-artifact@v4
with:
name: kotlin-bulk-cdk-docs-${{ github.sha }}
path: airbyte-cdk/bulk/build/dokka/htmlMultiModule/
retention-days: 30
vercel-preview:
name: Deploy Docs to Vercel (Preview)
needs: [detect-changes, build-docs]
# Only deploy for non-fork PRs and master branch, and when Vercel project is configured
if: >
needs.detect-changes.outputs.changed == 'true'
&& (
github.event_name == 'push'
|| github.event.pull_request.head.repo.full_name == github.repository
)
&& vars.VERCEL_KOTLIN_CDK_PROJECT_ID != ''
runs-on: ubuntu-24.04
env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ vars.VERCEL_KOTLIN_CDK_PROJECT_ID }}
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Download Documentation Artifact
uses: actions/download-artifact@v4
with:
name: kotlin-bulk-cdk-docs-${{ github.sha }}
path: docs-output/airbyte-cdk/bulk
- name: Debug - Show artifact structure
run: |
echo "📂 Artifact structure:"
ls -lah docs-output/airbyte-cdk/bulk
echo ""
echo "🔍 Looking for index.html:"
find docs-output -type f -name "index.html" -print
echo ""
echo "✅ Verifying deployment path..."
test -f docs-output/airbyte-cdk/bulk/index.html && echo "✅ index.html found at expected path" || echo "❌ index.html NOT found at expected path"
- name: Deploy to Vercel
id: deploy-vercel
uses: amondnet/vercel-action@v41.1.4
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
vercel-token: ${{ secrets.VERCEL_TOKEN }}
vercel-org-id: ${{ env.VERCEL_ORG_ID }}
vercel-project-id: ${{ env.VERCEL_PROJECT_ID }}
working-directory: docs-output
vercel-args: ${{ github.event_name == 'push' && '--prod' || '' }}
alias-domains: |
${{ github.event_name == 'push' && 'bulk-cdk-docs.vercel.app' || '' }}
- name: Authenticate as GitHub App
if: github.event_name == 'pull_request'
uses: actions/create-github-app-token@v2.0.6
id: get-app-token
with:
owner: "airbytehq"
repositories: "airbyte"
app-id: ${{ secrets.OCTAVIA_BOT_APP_ID }}
private-key: ${{ secrets.OCTAVIA_BOT_PRIVATE_KEY }}
- name: Post Custom Check with Preview URL
if: github.event_name == 'pull_request'
uses: LouisBrunner/checks-action@v2.0.0
with:
name: "Kotlin Bulk CDK Docs Preview"
status: completed
conclusion: success
details_url: ${{ steps.deploy-vercel.outputs.preview-url }}
token: ${{ steps.get-app-token.outputs.token }}
output: |
{"summary":"Documentation preview deployed successfully","text":"View the Kotlin Bulk CDK documentation at the preview URL"}