Repository navigation
Python and TypeScript SDKs: upload Flow Definition Graphs to the Dex Server #1971
Workflow file for this run
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 docs | |
| on: | |
| pull_request: | |
| paths: | |
| - 'docs/**' | |
| - 'packages/flow-definition-renderer/**' | |
| - 'web/app/design/**' | |
| - 'web/app/workspace/**' | |
| - '.github/workflows/deploy-docs.yml' | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - 'docs/**' | |
| - 'packages/flow-definition-renderer/**' | |
| - 'web/app/design/**' | |
| - 'web/app/workspace/**' | |
| - '.github/workflows/deploy-docs.yml' | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: deploy-docs-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| defaults: | |
| run: | |
| working-directory: docs | |
| env: | |
| VERSION_SCOPE: ${{ github.event_name == 'pull_request' && 'latest' || 'all' }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22' | |
| cache: npm | |
| cache-dependency-path: docs/scripts/api-reference-tools/package-lock.json | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version-file: sdk-go/go.mod | |
| cache-dependency-path: sdk-go/go.sum | |
| - name: Fetch SDK release tags and plan API reference cache | |
| id: api-plan | |
| env: | |
| DEX_API_TOOL_HASH: ${{ hashFiles('docs/scripts/build-api-reference.mjs', 'docs/scripts/refresh-api-reference-cache.mjs', 'docs/scripts/api-reference-tools/**') }} | |
| run: | | |
| echo "tool-hash=$DEX_API_TOOL_HASH" >> "$GITHUB_OUTPUT" | |
| entries_hash=$(node scripts/refresh-api-reference-cache.mjs plan "$VERSION_SCOPE") | |
| echo "entries-hash=$entries_hash" >> "$GITHUB_OUTPUT" | |
| - uses: actions/cache/restore@v4 | |
| id: api-cache | |
| with: | |
| path: docs/.cache/api-reference | |
| key: api-reference-tree-${{ runner.os }}-${{ steps.api-plan.outputs.entries-hash }} | |
| restore-keys: | | |
| api-reference-tree-${{ runner.os }}-${{ steps.api-plan.outputs.entries-hash }}- | |
| api-reference-tree-${{ runner.os }}- | |
| - name: Generate stale API references | |
| id: api-refresh | |
| env: | |
| DEX_API_TOOL_HASH: ${{ steps.api-plan.outputs.tool-hash }} | |
| run: node scripts/refresh-api-reference-cache.mjs refresh "$VERSION_SCOPE" | |
| # Saved before the docs build, so a later failure keeps the generated trees. | |
| # Partial sets are safe: stamps follow successful generation, and the run id prevents an exact hit. | |
| # An unchanged tree is already cached, so it is not saved again. | |
| - uses: actions/cache/save@v4 | |
| if: ${{ !cancelled() && fromJSON(steps.api-refresh.outputs.changed-tree-count || '0') > 0 }} | |
| with: | |
| path: docs/.cache/api-reference | |
| key: ${{ steps.api-cache.outputs.cache-primary-key }}-${{ github.run_id }} | |
| - name: Assemble and audit API HTML | |
| run: | | |
| node scripts/assemble-api-reference.mjs --allow-missing-versions --destination .cache/api-assembled | |
| npm run test:api -- .cache/api-assembled | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: npm | |
| cache-dependency-path: docs/package-lock.json | |
| - name: Install | |
| run: npm ci | |
| - name: Typecheck | |
| run: npm run typecheck | |
| - name: Build | |
| run: | | |
| npm run build | |
| touch build/.nojekyll | |
| - name: Assemble API reference | |
| env: | |
| EVENT_NAME: ${{ github.event_name }} | |
| run: | | |
| if [ "$EVENT_NAME" = pull_request ]; then | |
| node scripts/assemble-api-reference.mjs --allow-missing-versions | |
| else | |
| node scripts/assemble-api-reference.mjs | |
| fi | |
| - name: Smoke checks | |
| run: npm run test:site | |
| - name: Audit all retained API versions | |
| if: github.event_name != 'pull_request' | |
| run: npm run test:api -- build/api --all | |
| - name: Check GitHub Pages size budget | |
| run: | | |
| bytes=$(du -sb build | cut -f1) | |
| echo "Published site size: $bytes bytes (limit: 1000000000)" | |
| test "$bytes" -lt 1000000000 | |
| - uses: actions/upload-pages-artifact@v3 | |
| if: github.event_name == 'push' | |
| with: | |
| path: docs/build | |
| deploy: | |
| if: github.event_name == 'push' | |
| needs: build | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - id: deployment | |
| uses: actions/deploy-pages@v4 |