cheatingchelsea/amplify.yml
Derek Slenk 627da2c7ec Debug and fix Amplify environment variable access
- Add debugging commands to check environment variables
- Improve .env.production file creation logic
- Remove env config from next.config.ts to avoid conflicts

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-27 15:17:35 -04:00

30 lines
No EOL
867 B
YAML

version: 1
frontend:
phases:
preBuild:
commands:
- npm ci
- echo "Checking for environment variables..."
- printenv | grep YOUTUBE || echo "No YOUTUBE env vars found"
- echo "YOUTUBE_API_KEY value length:" $(echo -n "$YOUTUBE_API_KEY" | wc -c)
build:
commands:
- |
if [ ! -z "$YOUTUBE_API_KEY" ]; then
echo "YOUTUBE_API_KEY=$YOUTUBE_API_KEY" >> .env.production
echo "Created .env.production with YOUTUBE_API_KEY"
else
echo "WARNING: YOUTUBE_API_KEY is not set in environment"
fi
- cat .env.production 2>/dev/null || echo "No .env.production file"
- npm run build
artifacts:
baseDirectory: .next
files:
- '**/*'
cache:
paths:
- node_modules/**/*
- .next/cache/**/*
buildPath: /
appRoot: /