docs(operate): document redesigned PI page and call activity navigation #22291
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: preview-env-deploy | |
| on: | |
| pull_request: | |
| types: [labeled, synchronize] | |
| concurrency: | |
| cancel-in-progress: true | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| jobs: | |
| build-docs: | |
| if: > | |
| github.event.pull_request.state != 'closed' && | |
| contains(github.event.pull_request.labels.*.name, 'deploy') | |
| # Use self-hosted runner with more resources | |
| runs-on: gcp-core-16-default | |
| # The execution of a job shares the same container and resources as the runner agent | |
| # that communicates with GitHub. Excessive and intensive consumption of resources | |
| # by a job steps may starve the runner agent to the point where communication is lost, | |
| # forcing GitHub to consider it offline. To prevent this, we can use a separate container | |
| # with its own resources for the job execution. | |
| container: node:24 | |
| name: build-docs | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: Import secrets from Vault | |
| id: secrets | |
| uses: hashicorp/vault-action@79632e33d6953d190b940ffa440bf97821cabd80 | |
| with: | |
| url: ${{ secrets.VAULT_ADDR }} | |
| method: approle | |
| roleId: ${{ secrets.VAULT_ROLE_ID }} | |
| secretId: ${{ secrets.VAULT_SECRET_ID }} | |
| secrets: | | |
| secret/data/products/camunda-docs/ci/preview-environment PREVIEW_ENV_BUCKET_NAME; | |
| secret/data/products/camunda-docs/ci/preview-environment PREVIEW_ENV_GCLOUD_SA_KEY; | |
| - name: Upsert comment with build status | |
| uses: mshick/add-pr-comment@v3 | |
| with: | |
| refresh-message-position: true | |
| message: | | |
| :construction: The preview environment for the commit ${{ github.sha }} is being built. This usually takes 8-10 minutes. | |
| - name: Install Dependencies | |
| run: npm ci | |
| - name: Cache Docusaurus | |
| uses: ./.github/actions/docusaurus-cache | |
| - name: Build Docs | |
| env: | |
| NODE_OPTIONS: --max-old-space-size=30720 | |
| DOCS_SITE_URL: https://${{ steps.secrets.outputs.PREVIEW_ENV_BUCKET_NAME }} | |
| DOCS_SITE_BASE_URL: /pr-${{ github.event.number }}/ | |
| run: npm run build | |
| - name: Upload build | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: docs-build | |
| path: build | |
| include-hidden-files: true | |
| deploy-preview: | |
| name: deploy-preview-env | |
| runs-on: ubuntu-24.04 | |
| needs: build-docs | |
| timeout-minutes: 30 | |
| steps: | |
| - name: Import secrets from Vault | |
| id: secrets | |
| uses: hashicorp/vault-action@79632e33d6953d190b940ffa440bf97821cabd80 | |
| with: | |
| url: ${{ secrets.VAULT_ADDR }} | |
| method: approle | |
| roleId: ${{ secrets.VAULT_ROLE_ID }} | |
| secretId: ${{ secrets.VAULT_SECRET_ID }} | |
| secrets: | | |
| secret/data/products/camunda-docs/ci/preview-environment PREVIEW_ENV_BUCKET_NAME; | |
| secret/data/products/camunda-docs/ci/preview-environment PREVIEW_ENV_GCLOUD_SA_KEY; | |
| - name: Download build | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: docs-build | |
| path: build | |
| - name: Authenticate with Google Cloud | |
| uses: google-github-actions/auth@v3 | |
| with: | |
| credentials_json: ${{ steps.secrets.outputs.PREVIEW_ENV_GCLOUD_SA_KEY }} | |
| - name: Set up Cloud SDK | |
| uses: google-github-actions/setup-gcloud@v3 | |
| - name: Start Deployment | |
| uses: bobheadxi/deployments@v1 | |
| id: deployment | |
| with: | |
| step: start | |
| token: ${{ github.token }} | |
| env: ${{ github.event.repository.name }} | |
| ref: ${{ github.event.pull_request.head.sha }} | |
| - name: Update comment with upload status | |
| uses: mshick/add-pr-comment@v3 | |
| with: | |
| refresh-message-position: true | |
| message: | | |
| :arrow_up: The preview environment build results for commit ${{ github.sha }} are being uploaded. This usually takes 3-4 minutes. | |
| - name: Upload files to Google bucket | |
| env: | |
| BUCKET_NAME: ${{ steps.secrets.outputs.PREVIEW_ENV_BUCKET_NAME }} | |
| run: | | |
| gcloud storage rsync --gzip-in-flight-all --delete-unmatched-destination-objects --recursive build gs://$BUCKET_NAME/pr-${{ github.event.number }} | |
| - uses: bobheadxi/deployments@v1 | |
| with: | |
| step: finish | |
| token: ${{ github.token }} | |
| status: ${{ job.status }} | |
| env: ${{ steps.deployment.outputs.env }} | |
| deployment_id: ${{ steps.deployment.outputs.deployment_id }} | |
| env_url: https://${{ steps.secrets.outputs.PREVIEW_ENV_BUCKET_NAME }}/pr-${{ github.event.number }}/index.html | |
| - name: Update comment with deployment status | |
| uses: mshick/add-pr-comment@v3 | |
| env: | |
| BUCKET_NAME: ${{ steps.secrets.outputs.PREVIEW_ENV_BUCKET_NAME }} | |
| with: | |
| refresh-message-position: true | |
| message: | | |
| The preview environment relating to the commit ${{ github.sha }} has successfully been deployed. You can access it at [https://${{ env.BUCKET_NAME }}/pr-${{ github.event.number }}/](https://${{ env.BUCKET_NAME }}/pr-${{ github.event.number }}/) | |
| retry-shutdowns: | |
| # Because we run these jobs on preemptible runners, they can be shut down | |
| # automatically at any time. Instead of requiring a manual rerun every time | |
| # this happens, use the reusable action developed by the infra team to retry. | |
| runs-on: ubuntu-latest | |
| needs: | |
| - build-docs | |
| - deploy-preview | |
| if: failure() && fromJSON(github.run_attempt) < 3 | |
| steps: | |
| - name: Retry job | |
| uses: camunda/infra-global-github-actions/rerun-failed-run@main | |
| with: | |
| error-messages: | | |
| The runner has received a shutdown signal. | |
| The operation was canceled. | |
| run-id: ${{ github.run_id }} | |
| repository: ${{ github.repository }} | |
| vault-addr: ${{ secrets.VAULT_ADDR }} | |
| vault-role-id: ${{ secrets.VAULT_ROLE_ID }} | |
| vault-secret-id: ${{ secrets.VAULT_SECRET_ID }} |