fix: pre-seed chart cumulative scores and add light mode prose table … #51
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 Backend to AWS Lambda | |
| on: | |
| push: | |
| branches: [ main ] | |
| paths: | |
| - 'backend/**' | |
| - '.github/workflows/backend-deploy.yml' | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| env: | |
| FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.24' | |
| cache-dependency-path: backend/go.sum | |
| - name: Setup AWS SAM CLI | |
| uses: aws-actions/setup-sam@v2 | |
| - name: Configure AWS credentials | |
| uses: aws-actions/configure-aws-credentials@v4 | |
| with: | |
| aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
| aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
| aws-region: us-east-1 | |
| - name: Mask infrastructure URLs from logs | |
| run: | | |
| python3 -c " | |
| import boto3, subprocess, sys | |
| cf = boto3.client('cloudformation', region_name='us-east-1') | |
| try: | |
| resp = cf.describe_stacks(StackName='rootaccess-backend') | |
| for o in resp['Stacks'][0].get('Outputs', []): | |
| val = o['OutputValue'] | |
| if val: | |
| print(f'::add-mask::{val}') | |
| except Exception: | |
| pass # First deploy — no stack yet | |
| " | |
| - name: Build and Package | |
| working-directory: backend | |
| run: | | |
| sam build | |
| - name: Deploy to AWS (No VPC) | |
| working-directory: backend | |
| run: | | |
| sam deploy --no-confirm-changeset --no-fail-on-empty-changeset \ | |
| --stack-name rootaccess-backend \ | |
| --region us-east-1 \ | |
| --capabilities CAPABILITY_IAM \ | |
| --parameter-overrides "Environment=production SSMParameterPath=/RootAccess/Backend LambdaMemorySize=512" \ | |
| --resolve-s3 | |
| - name: Post-Deployment Sync (Update SSM) | |
| run: | | |
| python3 -c " | |
| import boto3 | |
| import sys | |
| region = 'us-east-1' | |
| stack_name = 'rootaccess-backend' | |
| ssm_path = '/RootAccess/Backend' | |
| cf_client = boto3.client('cloudformation', region_name=region) | |
| ssm_client = boto3.client('ssm', region_name=region) | |
| try: | |
| response = cf_client.describe_stacks(StackName=stack_name) | |
| outputs = response['Stacks'][0]['Outputs'] | |
| # Mask all output values so they don't leak in logs | |
| for o in outputs: | |
| val = o.get('OutputValue', '') | |
| if val: | |
| print(f'::add-mask::{val}') | |
| ws_callback_url = next((o['OutputValue'] for o in outputs if o['OutputKey'] == 'WebSocketCallbackUrl'), None) | |
| if ws_callback_url: | |
| ssm_client.put_parameter( | |
| Name=f'{ssm_path}/WS_CALLBACK_URL', | |
| Value=ws_callback_url, | |
| Type='SecureString', | |
| Overwrite=True | |
| ) | |
| print('Successfully synced SSM Parameter Store with stack outputs.') | |
| except Exception as e: | |
| print(f'Error syncing SSM parameters: {e}') | |
| sys.exit(1) | |
| " |