Repository navigation
server-zd: migrate the history of existing runs to segments #1539
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/v2/**' | |
| - '.github/workflows/deploy-docs.yml' | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - 'docs/**' | |
| - 'packages/flow-definition-renderer/**' | |
| - 'web/app/v2/**' | |
| - '.github/workflows/deploy-docs.yml' | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: deploy-docs-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| api-versions: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| outputs: | |
| matrix: ${{ steps.versions.outputs.matrix }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22' | |
| - id: versions | |
| env: | |
| VERSION_SCOPE: ${{ github.event_name == 'pull_request' && 'latest' || 'all' }} | |
| run: echo "matrix=$(node docs/scripts/build-api-reference.mjs --matrix "$VERSION_SCOPE")" >> "$GITHUB_OUTPUT" | |
| api-reference: | |
| needs: api-versions | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| strategy: | |
| fail-fast: false | |
| matrix: ${{ fromJSON(needs.api-versions.outputs.matrix) }} | |
| defaults: | |
| run: | |
| working-directory: docs | |
| 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 | |
| if: matrix.language == 'python' | |
| with: | |
| python-version: '3.12' | |
| - uses: actions/setup-go@v5 | |
| if: matrix.language == 'go' | |
| with: | |
| go-version-file: sdk-go/go.mod | |
| cache-dependency-path: sdk-go/go.sum | |
| - name: Fetch SDK release tag | |
| if: matrix.language != 'java' | |
| env: | |
| TAG: sdk-${{ matrix.language }}/v${{ matrix.version }} | |
| run: git fetch --no-tags --depth=1 origin "refs/tags/$TAG:refs/tags/$TAG" | |
| - id: source | |
| env: | |
| LANGUAGE: ${{ matrix.language }} | |
| SDK_VERSION: ${{ matrix.version }} | |
| run: | | |
| if [ "$LANGUAGE" = java ]; then | |
| # Maven Central artifacts are immutable, so the version identifies the Javadoc. | |
| echo "revision=maven-central" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "revision=$(git rev-parse "sdk-$LANGUAGE/v$SDK_VERSION^{commit}")" >> "$GITHUB_OUTPUT" | |
| fi | |
| - uses: actions/cache@v4 | |
| id: generated | |
| with: | |
| path: docs/.cache/api-reference/${{ matrix.language }}/${{ matrix.minor }} | |
| key: api-${{ runner.os }}-${{ matrix.language }}-${{ matrix.version }}-${{ steps.source.outputs.revision }}-${{ hashFiles('docs/scripts/build-api-reference.mjs', 'docs/scripts/api-reference-tools/**') }} | |
| - name: Generate API reference | |
| if: steps.generated.outputs.cache-hit != 'true' | |
| env: | |
| LANGUAGE: ${{ matrix.language }} | |
| SDK_VERSION: ${{ matrix.version }} | |
| run: node scripts/build-api-reference.mjs "$LANGUAGE" "sdk-$LANGUAGE/v$SDK_VERSION" | |
| - 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/upload-artifact@v4 | |
| with: | |
| name: api-${{ matrix.language }}-${{ matrix.version }} | |
| path: docs/.cache/api-reference/ | |
| if-no-files-found: error | |
| retention-days: 1 | |
| build: | |
| needs: api-reference | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: docs | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - 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 | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| pattern: api-* | |
| path: docs/.cache/api-reference | |
| merge-multiple: true | |
| - 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 | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - id: deployment | |
| uses: actions/deploy-pages@v4 |