Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

Seanaye/ci/crane deploy all (#3193)

Sean Ayecf097cd607ce
diff --git a/.github/actions/deploy-cloud-storage-pulumi/action.yml b/.github/actions/deploy-cloud-storage-pulumi/action.yml
index e544bda818..84a559b888 100644
--- a/.github/actions/deploy-cloud-storage-pulumi/action.yml
+++ b/.github/actions/deploy-cloud-storage-pulumi/action.yml
@@ -56,6 +56,10 @@ inputs:
description: 'Cachix auth token used for inline Lambda artifact builds'
required: false
default: ''
+ sccache-bucket:
+ description: 'Optional S3 bucket for shared sccache storage during inline Lambda artifact builds'
+ required: false
+ default: ''
runs:
using: composite
@@ -109,12 +113,15 @@ runs:
uses: ./.github/actions/setup-cachix
with:
cachix-auth-token: ${{ inputs.cachix-auth-token }}
+ sccache-bucket: ${{ inputs.sccache-bucket }}
- name: Build Lambda artifacts inline
if: ${{ inputs.lambda-artifacts == '' && inputs.cloud-storage-service-name != '' && steps.check-lambdas.outputs.has_lambdas == 'true' }}
shell: bash
env:
SERVICE: ${{ inputs.cloud-storage-service-name }}
+ AWS_ACCESS_KEY_ID: ${{ inputs.aws-access-key }}
+ AWS_SECRET_ACCESS_KEY: ${{ inputs.aws-secret-key }}
run: .github/scripts/build-cloud-storage-lambdas.sh
# setup docker
diff --git a/.github/actions/preview-cloud-storage-pulumi/action.yml b/.github/actions/preview-cloud-storage-pulumi/action.yml
index 0f1ec426ea..a09f9f6a53 100644
--- a/.github/actions/preview-cloud-storage-pulumi/action.yml
+++ b/.github/actions/preview-cloud-storage-pulumi/action.yml
@@ -52,6 +52,10 @@ inputs:
description: 'Cachix auth token used when building Lambda artifacts'
required: false
default: ''
+ sccache-bucket:
+ description: 'Optional S3 bucket for shared sccache storage during Lambda artifact builds'
+ required: false
+ default: ''
runs:
using: composite
@@ -66,6 +70,7 @@ runs:
uses: ./.github/actions/setup-cachix
with:
cachix-auth-token: ${{ inputs.cachix-auth-token }}
+ sccache-bucket: ${{ inputs.sccache-bucket }}
- name: Check Lambda config
if: ${{ inputs.cloud-storage-service-name != '' }}
@@ -82,6 +87,8 @@ runs:
shell: bash
env:
SERVICE: ${{ inputs.cloud-storage-service-name }}
+ AWS_ACCESS_KEY_ID: ${{ inputs.aws-access-key }}
+ AWS_SECRET_ACCESS_KEY: ${{ inputs.aws-secret-key }}
run: .github/scripts/build-cloud-storage-lambdas.sh
# setup docker
diff --git a/.github/actions/setup-cachix/action.yml b/.github/actions/setup-cachix/action.yml
index 9d010b59b1..2fb2826a79 100644
--- a/.github/actions/setup-cachix/action.yml
+++ b/.github/actions/setup-cachix/action.yml
@@ -14,6 +14,18 @@ inputs:
description: Enter the repository Nix dev shell after configuring Cachix.
required: false
default: 'false'
+ sccache-bucket:
+ description: Optional S3 bucket for shared sccache storage.
+ required: false
+ default: ''
+ sccache-region:
+ description: AWS region for the shared sccache S3 bucket.
+ required: false
+ default: us-east-1
+ sccache-s3-key-prefix:
+ description: S3 key prefix for shared sccache storage.
+ required: false
+ default: sccache/
runs:
using: composite
@@ -41,6 +53,26 @@ runs:
fi
cachix use "$CACHIX_CACHE_NAME"
+ - name: Configure sccache
+ shell: bash
+ env:
+ SCCACHE_BUCKET_INPUT: ${{ inputs.sccache-bucket }}
+ SCCACHE_REGION_INPUT: ${{ inputs.sccache-region }}
+ SCCACHE_S3_KEY_PREFIX_INPUT: ${{ inputs.sccache-s3-key-prefix }}
+ run: |
+ set -euo pipefail
+ mkdir -p "$HOME/.cache/sccache"
+ {
+ echo "SCCACHE_DIR=$HOME/.cache/sccache"
+ echo "SCCACHE_CACHE_SIZE=5G"
+ echo "SCCACHE_BASEDIR=${GITHUB_WORKSPACE:-$PWD}"
+ if [ -n "$SCCACHE_BUCKET_INPUT" ]; then
+ echo "SCCACHE_BUCKET=$SCCACHE_BUCKET_INPUT"
+ echo "SCCACHE_REGION=$SCCACHE_REGION_INPUT"
+ echo "SCCACHE_S3_KEY_PREFIX=$SCCACHE_S3_KEY_PREFIX_INPUT"
+ fi
+ } >> "$GITHUB_ENV"
+
- name: Enter Nix dev shell
if: ${{ inputs.dev-shell == 'true' }}
shell: bash
diff --git a/.github/actions/setup-reqs-web/action.yml b/.github/actions/setup-reqs-web/action.yml
index 213614eb75..132e1988c2 100644
--- a/.github/actions/setup-reqs-web/action.yml
+++ b/.github/actions/setup-reqs-web/action.yml
@@ -9,6 +9,10 @@ inputs:
description: Cachix auth token used to configure authenticated pulls.
required: false
default: ''
+ sccache-bucket:
+ description: Optional S3 bucket for shared sccache storage.
+ required: false
+ default: ''
runs:
using: composite
@@ -18,6 +22,7 @@ runs:
with:
cachix-auth-token: ${{ inputs.cachix-auth-token }}
dev-shell: 'true'
+ sccache-bucket: ${{ inputs.sccache-bucket }}
- name: Setup bunfig.toml
working-directory: js
diff --git a/.github/workflows/build-rust-ci-image.yml b/.github/workflows/build-rust-ci-image.yml
index 7eb3e55b5d..1c367790a0 100644
--- a/.github/workflows/build-rust-ci-image.yml
+++ b/.github/workflows/build-rust-ci-image.yml
@@ -44,6 +44,7 @@ jobs:
uses: ./.github/actions/setup-cachix
with:
cachix-auth-token: ${{ secrets.CACHIX_AUTH_TOKEN }}
+ sccache-bucket: ${{ vars.SCCACHE_BUCKET || secrets.SCCACHE_BUCKET }}
- name: Materialize dev shell into /nix/store
shell: bash
diff --git a/.github/workflows/code-check-cloud-storage.yml b/.github/workflows/code-check-cloud-storage.yml
index 48701dc98f..6c82e1a938 100644
--- a/.github/workflows/code-check-cloud-storage.yml
+++ b/.github/workflows/code-check-cloud-storage.yml
@@ -177,29 +177,13 @@ jobs:
with:
cachix-auth-token: ${{ secrets.CACHIX_AUTH_TOKEN }}
dev-shell: 'true'
+ sccache-bucket: ${{ vars.SCCACHE_BUCKET || secrets.SCCACHE_BUCKET }}
- uses: Swatinem/rust-cache@9d47c6ad4b02e050fd481d890b2ea34778fd09d6
with:
workspaces: rust/cloud-storage
shared-key: cloud-storage-check
cache-on-failure: true
cache-targets: false
- - name: Configure sccache S3 backend
- env:
- SCCACHE_BUCKET: ${{ vars.SCCACHE_BUCKET || secrets.SCCACHE_BUCKET }}
- run: |
- set -euo pipefail
- mkdir -p "$HOME/.cache/sccache"
- {
- echo "SCCACHE_DIR=$HOME/.cache/sccache"
- echo "SCCACHE_CACHE_SIZE=5G"
- echo "SCCACHE_BASEDIR=${GITHUB_WORKSPACE:-$PWD}"
- if [ -n "${SCCACHE_BUCKET:-}" ]; then
- echo "SCCACHE_BUCKET=${SCCACHE_BUCKET}"
- echo "SCCACHE_REGION=${SCCACHE_REGION:-us-east-1}"
- echo "SCCACHE_S3_KEY_PREFIX=${SCCACHE_S3_KEY_PREFIX:-sccache/}"
- fi
- } >> "$GITHUB_ENV"
- sccache --version
- name: fmt
run: cd rust/cloud-storage && cargo fmt --check
- name: clippy
@@ -252,29 +236,13 @@ jobs:
with:
cachix-auth-token: ${{ secrets.CACHIX_AUTH_TOKEN }}
dev-shell: 'true'
+ sccache-bucket: ${{ vars.SCCACHE_BUCKET || secrets.SCCACHE_BUCKET }}
- uses: Swatinem/rust-cache@9d47c6ad4b02e050fd481d890b2ea34778fd09d6
with:
workspaces: rust/cloud-storage
shared-key: cloud-storage-test
cache-on-failure: true
cache-targets: false
- - name: Configure sccache S3 backend
- env:
- SCCACHE_BUCKET: ${{ vars.SCCACHE_BUCKET || secrets.SCCACHE_BUCKET }}
- run: |
- set -euo pipefail
- mkdir -p "$HOME/.cache/sccache"
- {
- echo "SCCACHE_DIR=$HOME/.cache/sccache"
- echo "SCCACHE_CACHE_SIZE=5G"
- echo "SCCACHE_BASEDIR=${GITHUB_WORKSPACE:-$PWD}"
- if [ -n "${SCCACHE_BUCKET:-}" ]; then
- echo "SCCACHE_BUCKET=${SCCACHE_BUCKET}"
- echo "SCCACHE_REGION=${SCCACHE_REGION:-us-east-1}"
- echo "SCCACHE_S3_KEY_PREFIX=${SCCACHE_S3_KEY_PREFIX:-sccache/}"
- fi
- } >> "$GITHUB_ENV"
- sccache --version
- name: configure postgres for concurrent tests
run: |
postgres_container="$(docker ps --format '{{.ID}} {{.Image}}' | awk '$2 == "pgvector/pgvector:pg16" { print $1; exit }')"
diff --git a/.github/workflows/code-check-infra.yml b/.github/workflows/code-check-infra.yml
index 890ccc11b9..67d1c68848 100644
--- a/.github/workflows/code-check-infra.yml
+++ b/.github/workflows/code-check-infra.yml
@@ -41,6 +41,7 @@ jobs:
with:
cachix-auth-token: ${{ secrets.CACHIX_AUTH_TOKEN }}
dev-shell: 'true'
+ sccache-bucket: ${{ vars.SCCACHE_BUCKET || secrets.SCCACHE_BUCKET }}
- name: Run Biome
working-directory: infra
run: biome ci --changed --no-errors-on-unmatched --error-on-warnings
@@ -56,6 +57,7 @@ jobs:
with:
cachix-auth-token: ${{ secrets.CACHIX_AUTH_TOKEN }}
dev-shell: 'true'
+ sccache-bucket: ${{ vars.SCCACHE_BUCKET || secrets.SCCACHE_BUCKET }}
- name: install
working-directory: infra
run: bun install --frozen-lockfile
diff --git a/.github/workflows/deploy-all-services.yml b/.github/workflows/deploy-all-services.yml
index d8c826e863..73d7f1293c 100644
--- a/.github/workflows/deploy-all-services.yml
+++ b/.github/workflows/deploy-all-services.yml
@@ -29,6 +29,10 @@ on:
required: true
CACHIX_AUTH_TOKEN:
required: true
+ AWS_ACCESS_KEY_ID:
+ required: false
+ SCCACHE_BUCKET:
+ required: false
# Only run 1 deploy-all workflow at a time per environment
concurrency:
@@ -51,6 +55,61 @@ jobs:
echo "matrix=${services}" >> $GITHUB_OUTPUT
echo "Deploying services: ${services}"
+ build-service-binaries:
+ name: Build ${{ matrix.service }} binaries
+ needs: setup
+ if: ${{ needs.setup.outputs.matrix != '[]' }}
+ runs-on: linux-extra-beefy
+ strategy:
+ fail-fast: false
+ max-parallel: 8
+ matrix:
+ service: ${{ fromJson(needs.setup.outputs.matrix) }}
+ steps:
+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
+ with:
+ clean: false
+
+ - name: Configure Cachix
+ uses: ./.github/actions/setup-cachix
+ with:
+ cachix-auth-token: ${{ secrets.CACHIX_AUTH_TOKEN }}
+ sccache-bucket: ${{ vars.SCCACHE_BUCKET || secrets.SCCACHE_BUCKET }}
+
+ - name: Build prebuilt binaries
+ shell: bash
+ env:
+ SERVICE: ${{ matrix.service }}
+ run: |
+ set -euo pipefail
+ mkdir -p prebuilt
+
+ binaries=$(jq -r --arg service "$SERVICE" '.services[$service].deploy_binaries // [] | @tsv' .github/services-config.json)
+ if [[ -n "$binaries" ]]; then
+ cachix watch-store "$CACHIX_CACHE_NAME" &
+ cachix_pid=$!
+ trap 'kill "$cachix_pid" || true' EXIT
+
+ nix build ".#deploy-service-binaries-${SERVICE}"
+ cp -r result/bin/* prebuilt/
+ mkdir -p prebuilt/nix-store
+ while IFS= read -r store_path; do
+ cp -a "$store_path" prebuilt/nix-store/
+ done < <(nix-store -qR result)
+ else
+ echo "No deploy binaries configured for $SERVICE; uploading an empty artifact"
+ fi
+
+ touch prebuilt/.keep
+ tar -C prebuilt -czf prebuilt-binaries.tar.gz .
+
+ - name: Upload prebuilt binaries
+ uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
+ with:
+ name: cloud-storage-service-binaries-${{ matrix.service }}-${{ github.sha }}
+ path: prebuilt-binaries.tar.gz
+ retention-days: 7
+
build-lambda-artifacts:
name: Build ${{ matrix.service }} Lambda artifacts
needs: setup
@@ -70,6 +129,7 @@ jobs:
uses: ./.github/actions/setup-cachix
with:
cachix-auth-token: ${{ secrets.CACHIX_AUTH_TOKEN }}
+ sccache-bucket: ${{ vars.SCCACHE_BUCKET || secrets.SCCACHE_BUCKET }}
- name: Check Lambda config
id: check-lambdas
@@ -83,6 +143,8 @@ jobs:
if: ${{ steps.check-lambdas.outputs.has_lambdas == 'true' }}
env:
SERVICE: ${{ matrix.service }}
+ AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID || secrets.AWS_ACCESS_KEY }}
+ AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
run: .github/scripts/build-cloud-storage-lambdas.sh
- name: Upload Lambda artifacts
@@ -95,7 +157,7 @@ jobs:
deploy-services:
name: Deploy ${{ matrix.service }}
- needs: [setup, build-lambda-artifacts]
+ needs: [setup, build-service-binaries, build-lambda-artifacts]
if: ${{ needs.setup.outputs.matrix != '[]' }}
runs-on:
[
@@ -125,7 +187,9 @@ jobs:
env:
SERVICE: ${{ matrix.service }}
run: |
+ has_binaries=$(jq -r --arg service "$SERVICE" '((.services[$service].deploy_binaries // []) | length) > 0' .github/services-config.json)
has_lambdas=$(jq -r --arg service "$SERVICE" '((.services[$service].deploy_lambdas // []) | length) > 0' .github/services-config.json)
+ echo "has_binaries=$has_binaries" >> "$GITHUB_OUTPUT"
echo "has_lambdas=$has_lambdas" >> "$GITHUB_OUTPUT"
- name: Deploy ${{ matrix.service }}
@@ -136,6 +200,7 @@ jobs:
aws-secret-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
pulumi-access-token: ${{ secrets.PULUMI_ACCESS_TOKEN }}
pulumi-service-name: ${{ steps.project-name.outputs.project-name }}
+ prebuilt-binaries-artifact: ${{ steps.check-artifacts.outputs.has_binaries == 'true' && format('cloud-storage-service-binaries-{0}-{1}', matrix.service, github.sha) || '' }}
lambda-artifacts: ${{ steps.check-artifacts.outputs.has_lambdas == 'true' && format('cloud-storage-lambdas-{0}-{1}', matrix.service, github.sha) || '' }}
dd-app-key: ${{ secrets.DD_APP_KEY }}
dd-api-key: ${{ secrets.DD_API_KEY }}
@@ -143,7 +208,7 @@ jobs:
deployment-summary:
name: Deployment Summary
runs-on: ubuntu-latest
- needs: [setup, build-lambda-artifacts, deploy-services]
+ needs: [setup, build-service-binaries, build-lambda-artifacts, deploy-services]
if: always()
steps:
- name: Check deployment results
@@ -153,6 +218,9 @@ jobs:
exit 1
elif [[ "${{ needs.setup.result }}" == "skipped" ]]; then
echo "⏭️ Deployment setup was skipped"
+ elif [[ "${{ needs.build-service-binaries.result }}" == "failure" ]]; then
+ echo "❌ One or more service binary builds failed"
+ exit 1
elif [[ "${{ needs.build-lambda-artifacts.result }}" == "failure" ]]; then
echo "❌ One or more Lambda artifact builds failed"
exit 1
diff --git a/.github/workflows/deploy-cloud-storage-on-push.yml b/.github/workflows/deploy-cloud-storage-on-push.yml
index 1309aa82d1..60660a801a 100644
--- a/.github/workflows/deploy-cloud-storage-on-push.yml
+++ b/.github/workflows/deploy-cloud-storage-on-push.yml
@@ -128,6 +128,7 @@ jobs:
uses: ./.github/actions/setup-cachix
with:
cachix-auth-token: ${{ secrets.CACHIX_AUTH_TOKEN }}
+ sccache-bucket: ${{ vars.SCCACHE_BUCKET || secrets.SCCACHE_BUCKET }}
- name: Build prebuilt binaries
shell: bash
@@ -182,11 +183,14 @@ jobs:
uses: ./.github/actions/setup-cachix
with:
cachix-auth-token: ${{ secrets.CACHIX_AUTH_TOKEN }}
+ sccache-bucket: ${{ vars.SCCACHE_BUCKET || secrets.SCCACHE_BUCKET }}
- name: Build Lambda artifact
shell: bash
env:
LAMBDA: ${{ matrix.lambda }}
+ AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID || secrets.AWS_ACCESS_KEY }}
+ AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
run: |
set -euo pipefail
nix develop .# -c bash -lc '
diff --git a/.github/workflows/deploy-preview.yml b/.github/workflows/deploy-preview.yml
index 69139112bd..630b439436 100644
--- a/.github/workflows/deploy-preview.yml
+++ b/.github/workflows/deploy-preview.yml
@@ -34,6 +34,7 @@ jobs:
uses: ./.github/actions/setup-reqs-web
with:
cachix-auth-token: ${{ secrets.CACHIX_AUTH_TOKEN }}
+ sccache-bucket: ${{ vars.SCCACHE_BUCKET || secrets.SCCACHE_BUCKET }}
# Build identical to dev.macro.com deployment
- name: Build
diff --git a/.github/workflows/deploy-pulumi-stack.yml b/.github/workflows/deploy-pulumi-stack.yml
index 0650b60d68..1c608240b3 100644
--- a/.github/workflows/deploy-pulumi-stack.yml
+++ b/.github/workflows/deploy-pulumi-stack.yml
@@ -47,5 +47,6 @@ jobs:
pulumi-service-name: ${{ inputs.pulumi-service-name }} # TODO: we should have validation that this is a valid pulumi service name before we allow it to be set here
cloud-storage-service-name: ${{ inputs.cloud-storage-service-name }}
cachix-auth-token: ${{ secrets.CACHIX_AUTH_TOKEN }}
+ sccache-bucket: ${{ vars.SCCACHE_BUCKET || secrets.SCCACHE_BUCKET }}
dd-app-key: ${{ secrets.DD_APP_KEY }}
dd-api-key: ${{ secrets.DD_API_KEY }}
diff --git a/.github/workflows/deploy-services-batch.yml b/.github/workflows/deploy-services-batch.yml
deleted file mode 100644
index 972d74ac6a..0000000000
--- a/.github/workflows/deploy-services-batch.yml
+++ /dev/null
@@ -1,178 +0,0 @@
-name: Deploy Services (Batch)
-on:
- workflow_dispatch:
- inputs:
- environment:
- type: choice
- required: true
- default: 'dev'
- options:
- - dev
- - prod
- description: The environment to deploy to
- services:
- type: string
- required: true
- description: 'Comma-separated list of services to deploy (e.g., "document-cognition-service,static-file-service")'
-
-concurrency:
- group: deploy-batch-${{ inputs.environment }}-${{ github.run_id }}
- cancel-in-progress: false
-
-jobs:
- parse-services:
- name: Parse Services List
- runs-on: ubuntu-latest
- outputs:
- matrix: ${{ steps.parse.outputs.matrix }}
- steps:
- - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
- - name: Parse and validate services
- id: parse
- run: |
- # Split comma-separated list into array
- IFS=',' read -ra SERVICES <<< "${{ inputs.services }}"
-
- # Trim whitespace and validate each service
- valid_services=()
- invalid_services=()
-
- # Get valid service names from config
- all_services=$(jq -r '.services | keys[]' .github/services-config.json)
-
- for service in "${SERVICES[@]}"; do
- # Trim whitespace
- service=$(echo "$service" | xargs)
-
- # Check if service exists in config
- if echo "$all_services" | grep -q "^${service}$"; then
- valid_services+=("$service")
- else
- invalid_services+=("$service")
- fi
- done
-
- # Report invalid services
- if [ ${#invalid_services[@]} -gt 0 ]; then
- echo "⚠️ Warning: The following services are invalid and will be skipped:"
- printf '%s\n' "${invalid_services[@]}"
- fi
-
- # Create matrix JSON
- if [ ${#valid_services[@]} -eq 0 ]; then
- echo "❌ No valid services found in the input list"
- exit 1
- else
- echo "✅ Valid services to deploy:"
- printf '%s\n' "${valid_services[@]}"
- matrix=$(printf '%s\n' "${valid_services[@]}" | jq -R . | jq -s .)
- echo "matrix=${matrix}" >> $GITHUB_OUTPUT
- fi
-
- build-lambda-artifacts:
- name: Build ${{ matrix.service }} Lambda artifacts
- needs: parse-services
- runs-on: linux-extra-beefy
- strategy:
- fail-fast: false
- max-parallel: 8
- matrix:
- service: ${{ fromJson(needs.parse-services.outputs.matrix) }}
- steps:
- - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
- with:
- clean: false
-
- - name: Configure Cachix
- uses: ./.github/actions/setup-cachix
- with:
- cachix-auth-token: ${{ secrets.CACHIX_AUTH_TOKEN }}
-
- - name: Check Lambda config
- id: check-lambdas
- env:
- SERVICE: ${{ matrix.service }}
- run: |
- has_lambdas=$(jq -r --arg service "$SERVICE" '((.services[$service].deploy_lambdas // []) | length) > 0' .github/services-config.json)
- echo "has_lambdas=$has_lambdas" >> "$GITHUB_OUTPUT"
-
- - name: Build Lambda artifacts
- if: ${{ steps.check-lambdas.outputs.has_lambdas == 'true' }}
- env:
- SERVICE: ${{ matrix.service }}
- run: .github/scripts/build-cloud-storage-lambdas.sh
-
- - name: Upload Lambda artifacts
- if: ${{ steps.check-lambdas.outputs.has_lambdas == 'true' }}
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
- with:
- name: cloud-storage-lambdas-${{ matrix.service }}-${{ github.sha }}
- path: lambda-artifacts.tar.gz
- retention-days: 7
-
- deploy-services:
- name: Deploy ${{ matrix.service }}
- needs: [parse-services, build-lambda-artifacts]
- runs-on:
- [
- runs-on,
- runner=8cpu-linux-x64,
- hdd=40,
- spot=false,
- ssh=false,
- 'run-id=${{github.run_id}}',
- ]
- strategy:
- fail-fast: false
- max-parallel: 20 # Limit concurrent deployments
- matrix:
- service: ${{ fromJson(needs.parse-services.outputs.matrix) }}
- steps:
- - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
-
- - name: Get project name
- id: project-name
- uses: ./.github/actions/get-project-name
- with:
- service-name: ${{ matrix.service }}
-
- - name: Check artifact config
- id: check-artifacts
- env:
- SERVICE: ${{ matrix.service }}
- run: |
- has_lambdas=$(jq -r --arg service "$SERVICE" '((.services[$service].deploy_lambdas // []) | length) > 0' .github/services-config.json)
- echo "has_lambdas=$has_lambdas" >> "$GITHUB_OUTPUT"
-
- - name: Deploy ${{ matrix.service }}
- uses: ./.github/actions/deploy-cloud-storage-pulumi
- with:
- environment: ${{ inputs.environment }}
- aws-access-key: ${{ secrets.AWS_ACCESS_KEY }}
- aws-secret-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
- pulumi-access-token: ${{ secrets.PULUMI_ACCESS_TOKEN }}
- pulumi-service-name: ${{ steps.project-name.outputs.project-name }}
- lambda-artifacts: ${{ steps.check-artifacts.outputs.has_lambdas == 'true' && format('cloud-storage-lambdas-{0}-{1}', matrix.service, github.sha) || '' }}
- dd-app-key: ${{ secrets.DD_APP_KEY }}
- dd-api-key: ${{ secrets.DD_API_KEY }}
-
- summary:
- name: Deployment Summary
- runs-on: ubuntu-latest
- needs: [parse-services, build-lambda-artifacts, deploy-services]
- if: always()
- steps:
- - name: Report results
- run: |
- if [[ "${{ needs.parse-services.result }}" == "failure" ]]; then
- echo "❌ Failed to parse services"
- exit 1
- elif [[ "${{ needs.build-lambda-artifacts.result }}" == "failure" ]]; then
- echo "❌ One or more Lambda artifact builds failed"
- exit 1
- elif [[ "${{ needs.deploy-services.result }}" == "failure" ]]; then
- echo "❌ One or more deployments failed"
- exit 1
- else
- echo "✅ All requested services deployed successfully to ${{ inputs.environment }}"
- fi
diff --git a/.github/workflows/deploy-web-app-dev-push.yml b/.github/workflows/deploy-web-app-dev-push.yml
index 035c25e116..de00a3f4bd 100644
--- a/.github/workflows/deploy-web-app-dev-push.yml
+++ b/.github/workflows/deploy-web-app-dev-push.yml
@@ -38,3 +38,5 @@ jobs:
DD_WEB_APP_TOKEN: ${{ secrets.DD_WEB_APP_TOKEN }}
SEGMENT_WRITE_KEY: ${{ secrets.SEGMENT_WRITE_KEY_PRODUCTION }}
POSTHOG_API_KEY: ${{ secrets.POSTHOG_API_KEY }}
+ CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }}
+ SCCACHE_BUCKET: ${{ secrets.SCCACHE_BUCKET }}
diff --git a/.github/workflows/deploy-web-app.yml b/.github/workflows/deploy-web-app.yml
index a54f5f67fa..aef0042210 100644
--- a/.github/workflows/deploy-web-app.yml
+++ b/.github/workflows/deploy-web-app.yml
@@ -43,6 +43,8 @@ on:
required: true
CACHIX_AUTH_TOKEN:
required: true
+ SCCACHE_BUCKET:
+ required: false
concurrency:
group: ${{ github.workflow }}-web-app-${{ inputs.environment }}
@@ -62,6 +64,7 @@ jobs:
uses: ./.github/actions/setup-reqs-web
with:
cachix-auth-token: ${{ secrets.CACHIX_AUTH_TOKEN }}
+ sccache-bucket: ${{ vars.SCCACHE_BUCKET || secrets.SCCACHE_BUCKET }}
- name: Build
working-directory: js/app
run: just build-${{ inputs.environment }}
diff --git a/.github/workflows/release-production.yml b/.github/workflows/release-production.yml
index 439cbdf9a7..d1d9dada97 100644
--- a/.github/workflows/release-production.yml
+++ b/.github/workflows/release-production.yml
@@ -36,6 +36,8 @@ jobs:
DD_APP_KEY: ${{ secrets.DD_APP_KEY }}
DD_API_KEY: ${{ secrets.DD_API_KEY }}
CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }}
+ AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
+ SCCACHE_BUCKET: ${{ secrets.SCCACHE_BUCKET }}
build:
name: Build
@@ -50,6 +52,7 @@ jobs:
uses: ./.github/actions/setup-reqs-web
with:
cachix-auth-token: ${{ secrets.CACHIX_AUTH_TOKEN }}
+ sccache-bucket: ${{ vars.SCCACHE_BUCKET || secrets.SCCACHE_BUCKET }}
- name: Build for Production
working-directory: js/app
run: just build-prod
@@ -79,6 +82,7 @@ jobs:
uses: ./.github/actions/setup-reqs-web
with:
cachix-auth-token: ${{ secrets.CACHIX_AUTH_TOKEN }}
+ sccache-bucket: ${{ vars.SCCACHE_BUCKET || secrets.SCCACHE_BUCKET }}
- name: Download Build Artifact
uses: actions/download-artifact@v5
with:
diff --git a/.github/workflows/reusable-deploy-service.yml b/.github/workflows/reusable-deploy-service.yml
index 4d214615cd..247d1f383a 100644
--- a/.github/workflows/reusable-deploy-service.yml
+++ b/.github/workflows/reusable-deploy-service.yml
@@ -37,6 +37,10 @@ on:
required: true
CACHIX_AUTH_TOKEN:
required: true
+ AWS_ACCESS_KEY_ID:
+ required: false
+ SCCACHE_BUCKET:
+ required: false
jobs:
build-service-binaries:
@@ -55,6 +59,7 @@ jobs:
uses: ./.github/actions/setup-cachix
with:
cachix-auth-token: ${{ secrets.CACHIX_AUTH_TOKEN }}
+ sccache-bucket: ${{ vars.SCCACHE_BUCKET || secrets.SCCACHE_BUCKET }}
- name: Check prebuilt binaries config
id: check-binaries
@@ -108,6 +113,7 @@ jobs:
uses: ./.github/actions/setup-cachix
with:
cachix-auth-token: ${{ secrets.CACHIX_AUTH_TOKEN }}
+ sccache-bucket: ${{ vars.SCCACHE_BUCKET || secrets.SCCACHE_BUCKET }}
- name: Check Lambda config
id: check-lambdas
@@ -121,6 +127,8 @@ jobs:
if: ${{ steps.check-lambdas.outputs.has_lambdas == 'true' }}
env:
SERVICE: ${{ inputs.service-name }}
+ AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID || secrets.AWS_ACCESS_KEY }}
+ AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
run: .github/scripts/build-cloud-storage-lambdas.sh
- name: Upload Lambda artifacts
diff --git a/.github/workflows/reusable-preview-service.yml b/.github/workflows/reusable-preview-service.yml
index af8410a5e6..7ddda28bf2 100644
--- a/.github/workflows/reusable-preview-service.yml
+++ b/.github/workflows/reusable-preview-service.yml
@@ -41,6 +41,8 @@ on:
required: true
CACHIX_AUTH_TOKEN:
required: true
+ SCCACHE_BUCKET:
+ required: false
jobs:
preview:
@@ -68,3 +70,4 @@ jobs:
github-token: ${{ inputs.github-token }}
cloud-storage-service-name: ${{ inputs.service-name }}
cachix-auth-token: ${{ secrets.CACHIX_AUTH_TOKEN }}
+ sccache-bucket: ${{ vars.SCCACHE_BUCKET || secrets.SCCACHE_BUCKET }}
diff --git a/.github/workflows/web-app-check-main.yml b/.github/workflows/web-app-check-main.yml
index 68b0b8b226..e30e33ea34 100644
--- a/.github/workflows/web-app-check-main.yml
+++ b/.github/workflows/web-app-check-main.yml
@@ -58,6 +58,7 @@ jobs:
uses: ./.github/actions/setup-reqs-web
with:
cachix-auth-token: ${{ secrets.CACHIX_AUTH_TOKEN }}
+ sccache-bucket: ${{ vars.SCCACHE_BUCKET || secrets.SCCACHE_BUCKET }}
- uses: Swatinem/rust-cache@9d47c6ad4b02e050fd481d890b2ea34778fd09d6
if: needs.path-check.outputs.api_changed == 'true'
with:
@@ -65,24 +66,6 @@ jobs:
shared-key: cloud-storage-gen-api
cache-on-failure: true
cache-targets: true
- - name: Configure sccache S3 backend
- if: needs.path-check.outputs.api_changed == 'true'
- env:
- SCCACHE_BUCKET: ${{ vars.SCCACHE_BUCKET || secrets.SCCACHE_BUCKET }}
- run: |
- set -euo pipefail
- mkdir -p "$HOME/.cache/sccache"
- {
- echo "SCCACHE_DIR=$HOME/.cache/sccache"
- echo "SCCACHE_CACHE_SIZE=5G"
- echo "SCCACHE_BASEDIR=${GITHUB_WORKSPACE:-$PWD}"
- if [ -n "${SCCACHE_BUCKET:-}" ]; then
- echo "SCCACHE_BUCKET=${SCCACHE_BUCKET}"
- echo "SCCACHE_REGION=${SCCACHE_REGION:-us-east-1}"
- echo "SCCACHE_S3_KEY_PREFIX=${SCCACHE_S3_KEY_PREFIX:-sccache/}"
- fi
- } >> "$GITHUB_ENV"
- sccache --version
- name: Generate API Types
if: needs.path-check.outputs.api_changed == 'true'
working-directory: js/app
@@ -116,6 +99,7 @@ jobs:
with:
cachix-auth-token: ${{ secrets.CACHIX_AUTH_TOKEN }}
dev-shell: 'true'
+ sccache-bucket: ${{ vars.SCCACHE_BUCKET || secrets.SCCACHE_BUCKET }}
- name: Run Biome
working-directory: js/app
run: biome ci --changed --no-errors-on-unmatched --error-on-warnings
@@ -134,6 +118,7 @@ jobs:
uses: ./.github/actions/setup-reqs-web
with:
cachix-auth-token: ${{ secrets.CACHIX_AUTH_TOKEN }}
+ sccache-bucket: ${{ vars.SCCACHE_BUCKET || secrets.SCCACHE_BUCKET }}
- name: Check Tailwind Classes
working-directory: js/app
run: just check-tailwind
@@ -150,6 +135,7 @@ jobs:
uses: ./.github/actions/setup-reqs-web
with:
cachix-auth-token: ${{ secrets.CACHIX_AUTH_TOKEN }}
+ sccache-bucket: ${{ vars.SCCACHE_BUCKET || secrets.SCCACHE_BUCKET }}
playwright: 'true'
- name: Test
working-directory: js/app
@@ -168,6 +154,7 @@ jobs:
with:
cachix-auth-token: ${{ secrets.CACHIX_AUTH_TOKEN }}
dev-shell: 'true'
+ sccache-bucket: ${{ vars.SCCACHE_BUCKET || secrets.SCCACHE_BUCKET }}
- name: Cycles Import Check
working-directory: js/app
run: biome lint --changed --no-errors-on-unmatched --only=suspicious/noImportCycles
@@ -184,6 +171,7 @@ jobs:
uses: ./.github/actions/setup-reqs-web
with:
cachix-auth-token: ${{ secrets.CACHIX_AUTH_TOKEN }}
+ sccache-bucket: ${{ vars.SCCACHE_BUCKET || secrets.SCCACHE_BUCKET }}
- name: Build
working-directory: js/app
run: bun run build