Docs flex manual dynamic #2055
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: 'Docs build and deploy' | |
| on: | |
| pull_request: | |
| paths: | |
| - 'docs/**' | |
| - '.github/workflows/docs-build-deploy.yaml' | |
| - 'scripts/static-deploy/**' | |
| push: | |
| branches: | |
| - 'edge' | |
| - 'chore_release*' | |
| tags: | |
| - 'staging-MKDOCS*' | |
| - 'staging-mkdocs*' | |
| - 'MKDOCS*' | |
| - 'mkdocs*' | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-${{ github.ref_name != 'edge' || github.run_id}}-${{ github.ref_type != 'tag' || github.run_id }} | |
| cancel-in-progress: true | |
| defaults: | |
| run: | |
| shell: bash | |
| env: | |
| CI: 'true' | |
| # This is the artifact directory as a relative path | |
| # to the working-directory of our tools: scripts/static-deploy | |
| # our script deploy_ci_config.py expects this ENV variable is set | |
| RELATIVE_ARTIFACT_DIR: '../../dist' | |
| jobs: | |
| build-docs: | |
| timeout-minutes: 5 | |
| runs-on: ubuntu-24.04 | |
| permissions: | |
| id-token: write | |
| contents: read | |
| env: | |
| BRANCH: ${{ github.event.pull_request.head.ref != '' && github.event.pull_request.head.ref || github.ref_name }} | |
| outputs: | |
| artifacts-path: ${{ steps.upload-artifacts.outputs.path }} | |
| steps: | |
| - name: 'Checkout Repository' | |
| uses: actions/checkout@v5 | |
| - name: Setup UV | |
| uses: astral-sh/setup-uv@v6 | |
| with: | |
| python-version: '3.10' | |
| enable-cache: true | |
| cache-dependency-glob: './docs/uv.lock' | |
| - name: Setup Docs Dependencies | |
| working-directory: ./docs | |
| run: make setup | |
| - name: Build Docs | |
| working-directory: ./docs | |
| run: make build | |
| - name: Upload Artifacts | |
| id: upload-artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: docs-artifacts | |
| path: | | |
| docs/site/ | |
| retention-days: 1 | |
| determine-deploy-config: | |
| name: Determine Deployment Configuration | |
| runs-on: ubuntu-24.04 | |
| outputs: | |
| application: ${{ steps.deploy-config.outputs.APPLICATION }} | |
| environment: ${{ steps.deploy-config.outputs.ENVIRONMENT }} | |
| sandbox_prefix: ${{ steps.deploy-config.outputs.SANDBOX_PREFIX }} | |
| relative_artifact_dir: ${{ steps.deploy-config.outputs.RELATIVE_ARTIFACT_DIR }} | |
| branch: ${{ steps.config.outputs.branch }} | |
| bucket: ${{ steps.config.outputs.bucket }} | |
| url: ${{ steps.config.outputs.url }} | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v5 | |
| - uses: ./.github/actions/git/resolve-tag | |
| - name: Setup UV | |
| uses: astral-sh/setup-uv@v6 | |
| with: | |
| python-version: '3.10' | |
| enable-cache: true | |
| - name: Setup Deploy Dependencies | |
| working-directory: scripts/static-deploy | |
| run: make setup | |
| - name: Determine Deployment Configuration | |
| id: deploy-config | |
| working-directory: scripts/static-deploy | |
| run: make resolve-ci | |
| deploy-docs: | |
| needs: | |
| - build-docs | |
| - determine-deploy-config | |
| timeout-minutes: 5 | |
| runs-on: ubuntu-24.04 | |
| permissions: | |
| id-token: write | |
| contents: read | |
| env: | |
| ENVIRONMENT: ${{ needs.determine-deploy-config.outputs.ENVIRONMENT }} | |
| BRANCH: ${{ needs.determine-deploy-config.outputs.branch }} | |
| BUCKET: ${{ needs.determine-deploy-config.outputs.bucket }} | |
| URL: ${{ needs.determine-deploy-config.outputs.url }} | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v5 | |
| - id: resolve-tag | |
| uses: ./.github/actions/git/resolve-tag | |
| - name: Setup UV | |
| uses: astral-sh/setup-uv@v6 | |
| with: | |
| python-version: '3.10' | |
| enable-cache: true | |
| - name: Setup Deploy Dependencies | |
| working-directory: scripts/static-deploy | |
| run: make setup | |
| - name: Configure AWS Credentials | |
| uses: aws-actions/configure-aws-credentials@v4 | |
| with: | |
| role-to-assume: ${{ secrets.STATIC_DEPLOYMENT_ROLE }} | |
| aws-region: us-east-2 | |
| - name: Download Artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: docs-artifacts | |
| path: ./dist # in the default workspace | |
| # RELATIVE_ARTIFACT_DIR is set to ../../dist | |
| # because that is the relative path from scripts/static-deploy | |
| # to the this location | |
| - name: Deploy to S3 | |
| working-directory: scripts/static-deploy | |
| run: make deploy \ | |
| APPLICATION=${{ needs.determine-deploy-config.outputs.application }} \ | |
| ENVIRONMENT=${{ needs.determine-deploy-config.outputs.environment }} \ | |
| SANDBOX_PREFIX=${{ needs.determine-deploy-config.outputs.sandbox_prefix }} \ | |
| RELATIVE_ARTIFACT_DIR=${{ needs.determine-deploy-config.outputs.relative_artifact_dir }} | |
| - name: Output Deployment URL | |
| run: | | |
| echo "## 🚀 Docs site deployed to ${{ env.ENVIRONMENT }}" >> $GITHUB_STEP_SUMMARY | |
| echo "<${{ env.URL }}>" >> $GITHUB_STEP_SUMMARY |