realtime message feature added #9
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: Vercel Production Deployment | |
| env: | |
| VERCEL_ORG_ID: ${{ secrets.ORGID }} | |
| VERCEL_PROJECT_ID: ${{ secrets.PROJECTID }} | |
| NPM_CONFIG_LEGACY_PEER_DEPS: "true" | |
| on: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| Deploy-Production: | |
| environment: production | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: npm | |
| - name: Install Vercel CLI | |
| run: npm install --global vercel@latest | |
| - name: Pull Vercel Environment Information | |
| run: vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }} | |
| - name: Create dotenv files from GitHub Environment secret | |
| env: | |
| DOTENV: ${{ secrets.PRODUCTION }} | |
| run: | | |
| mkdir -p .vercel | |
| printf "%s" "$DOTENV" > .env | |
| printf "%s" "$DOTENV" > .env.production | |
| printf "%s" "$DOTENV" > .vercel/.env.production.local | |
| - name: Verify required env vars present | |
| run: | | |
| if [ ! -s .env ]; then | |
| echo ".env is empty. This usually means the GitHub Environment secret named 'PRODUCTION' is missing (or empty) in the 'production' environment." | |
| exit 1 | |
| fi | |
| echo "dotenv bytes: $(wc -c < .env)" | |
| # Allow optional leading whitespace and optional 'export ' | |
| if grep -qE '^[[:space:]]*(export[[:space:]]+)?NEXT_PUBLIC_PUSHER_APP_KEY[[:space:]]*=' .env 2>/dev/null; then | |
| echo "Found NEXT_PUBLIC_PUSHER_APP_KEY in .env" | |
| # Safe debug: show the matched key with value redacted | |
| grep -nE '^[[:space:]]*(export[[:space:]]+)?NEXT_PUBLIC_PUSHER_APP_KEY[[:space:]]*=' .env | \ | |
| sed -E 's/(NEXT_PUBLIC_PUSHER_APP_KEY[[:space:]]*=).*/\1***REDACTED***/' | |
| exit 0 | |
| fi | |
| echo "Missing NEXT_PUBLIC_PUSHER_APP_KEY in dotenv content. Ensure the PRODUCTION secret value includes the full line: NEXT_PUBLIC_PUSHER_APP_KEY=... (not just the key value)." | |
| exit 1 | |
| - name: Install dependencies (legacy peer deps) | |
| run: npm ci --legacy-peer-deps | |
| - name: Build Project Artifacts | |
| run: vercel build --prod --token=${{ secrets.VERCEL_TOKEN }} | |
| - name: Deploy Project Artifacts to Vercel | |
| run: vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }} |