Skip to content

Fix Codex hub screen run handling #171

Fix Codex hub screen run handling

Fix Codex hub screen run handling #171

Workflow file for this run

name: Deploy staging
on:
push:
branches:
- staging
paths-ignore:
- "apps/iris-device/**"
- "scripts/publish-device-ota.sh"
- ".github/workflows/deploy-device-staging.yml"
workflow_dispatch:
permissions:
contents: read
id-token: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
deploy:
name: Deploy Iris staging
runs-on: blacksmith-4vcpu-ubuntu-2404
environment: staging
timeout-minutes: 60
env:
AWS_REGION: us-west-2
steps:
- name: Checkout
uses: actions/checkout@v5
with:
fetch-depth: 50
- name: Setup Node
uses: actions/setup-node@v6
with:
node-version: 22
- name: Enable pnpm
run: corepack enable
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Typecheck
run: pnpm typecheck
- name: Check staging deploy configuration
env:
AWS_ROLE_TO_ASSUME: ${{ secrets.AWS_ROLE_TO_ASSUME }}
run: |
if [ -z "$AWS_ROLE_TO_ASSUME" ]; then
echo "Missing GitHub Environment secret: AWS_ROLE_TO_ASSUME" >&2
exit 1
fi
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v6.1.0
with:
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
aws-region: ${{ env.AWS_REGION }}
role-session-name: iris-staging-deploy
- name: Setup Blacksmith Docker builder
uses: useblacksmith/setup-docker-builder@v1
with:
max-cache-size-mb: "102400"
- name: Choose CDK deployment mode
id: deploy-mode
run: |
hotswap_args="--hotswap-fallback --require-approval never"
full_args="--require-approval never"
if [ "${{ github.event_name }}" != "push" ]; then
echo "args=${full_args}" >> "$GITHUB_OUTPUT"
exit 0
fi
base_sha="${{ github.event.before }}"
if [ -z "$base_sha" ] || [ "$base_sha" = "0000000000000000000000000000000000000000" ]; then
echo "args=${full_args}" >> "$GITHUB_OUTPUT"
exit 0
fi
if ! git cat-file -e "${base_sha}^{commit}" 2>/dev/null; then
git fetch --no-tags --depth=50 origin "${{ github.ref_name }}"
fi
changed_files="$(git diff --name-only "$base_sha" "$GITHUB_SHA")"
if printf '%s\n' "$changed_files" | grep -Eq '^(infra/aws/|\.github/workflows/deploy-staging\.yml|package\.json|pnpm-lock\.yaml|pnpm-workspace\.yaml)'; then
echo "args=${full_args}" >> "$GITHUB_OUTPUT"
else
echo "args=${hotswap_args}" >> "$GITHUB_OUTPUT"
fi
- name: Deploy staging CDK stack
run: pnpm --filter @iris/aws-infra cdk deploy iris-api-staging -c environment=staging ${{ steps.deploy-mode.outputs.args }}