Files
alexa-amundson-resume/.github/workflows/deploy-pi.yml
Claude 20232bfd69 feat: add real Stripe integration, e2e tests, and Pi deployment
Replace documentation-only repo with working code:

- Stripe integration: webhook handler (8 event types), billing API
  (customers, checkout, payments, subscriptions, invoices)
- Express API server with health endpoint, structured logging
- E2E tests (Playwright): health, webhook signature verification,
  billing API validation
- Unit tests: webhook event handler coverage for all event types
- Pi deployment: deploy.sh (rsync + systemd), NGINX load balancer
  across Pi cluster, Docker support
- CI/CD: test workflow, Pi deploy workflow, updated auto-deploy
  and self-healing to run real tests before deploying
- Move resume docs to docs/ to separate code from documentation

https://claude.ai/code/session_01Mf5Pg82fV6BTRS9GnpV7nr
2026-03-04 09:00:51 +00:00

58 lines
1.6 KiB
YAML

name: Deploy to Pi
on:
workflow_dispatch:
push:
branches: [main, master]
paths:
- 'src/**'
- 'package.json'
- 'Dockerfile'
- 'deploy/**'
jobs:
test:
name: Run Tests First
uses: ./.github/workflows/test.yml
deploy:
name: Deploy to Raspberry Pi Nodes
runs-on: ubuntu-latest
needs: test
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master'
steps:
- uses: actions/checkout@v4
- name: Setup SSH key
run: |
mkdir -p ~/.ssh
echo "${{ secrets.PI_SSH_PRIVATE_KEY }}" > ~/.ssh/id_ed25519
chmod 600 ~/.ssh/id_ed25519
ssh-keyscan -H ${{ secrets.PI_HOST_1 }} >> ~/.ssh/known_hosts 2>/dev/null || true
ssh-keyscan -H ${{ secrets.PI_HOST_2 }} >> ~/.ssh/known_hosts 2>/dev/null || true
ssh-keyscan -H ${{ secrets.PI_HOST_3 }} >> ~/.ssh/known_hosts 2>/dev/null || true
- name: Create .env for deployment
run: |
cat > .env <<EOF
STRIPE_SECRET_KEY=${{ secrets.STRIPE_SECRET_KEY }}
STRIPE_PUBLISHABLE_KEY=${{ secrets.STRIPE_PUBLISHABLE_KEY }}
STRIPE_WEBHOOK_SECRET=${{ secrets.STRIPE_WEBHOOK_SECRET }}
PORT=3000
NODE_ENV=production
PI_HOST_1=${{ secrets.PI_HOST_1 }}
PI_HOST_2=${{ secrets.PI_HOST_2 }}
PI_HOST_3=${{ secrets.PI_HOST_3 }}
PI_USER=${{ secrets.PI_USER }}
PI_DEPLOY_PATH=/opt/blackroad
PI_SSH_KEY=~/.ssh/id_ed25519
EOF
- name: Deploy to Pis
run: bash deploy/pi/deploy.sh
- name: Cleanup
if: always()
run: rm -f .env ~/.ssh/id_ed25519