Restore full buildspec.yml functionality with fixed YAML syntax #60
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 to AWS | |
| on: | |
| push: | |
| branches: [main] | |
| workflow_dispatch: # Allow manual trigger | |
| # Prevent multiple deployments from running simultaneously | |
| concurrency: | |
| group: deploy-${{ github.ref }} | |
| cancel-in-progress: false # Don't cancel running deployments, just queue them | |
| env: | |
| AWS_REGION: us-east-1 | |
| PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }} | |
| AWS_PAGER: "" | |
| jobs: | |
| deploy: | |
| name: Deploy Infrastructure | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| - 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: ${{ env.AWS_REGION }} | |
| # Login to ECR (needed for Docker push) | |
| - name: Login to Amazon ECR | |
| id: login-ecr | |
| uses: aws-actions/amazon-ecr-login@v2 | |
| # Deploy everything through Pulumi (handles Docker building and infrastructure) | |
| - name: Deploy with Pulumi | |
| run: | | |
| cd apps/infra | |
| bun install | |
| pulumi stack select compai/placeholder-dev --create | |
| pulumi up --yes | |
| # Cleanup on Pulumi failure only | |
| - name: Cleanup failed Pulumi deployment | |
| if: failure() | |
| run: | | |
| echo "🧹 Cleaning up failed Pulumi deployment..." | |
| cd apps/infra | |
| pulumi cancel --yes || true | |
| echo "Pulumi cleanup completed" | |
| - name: Deployment complete | |
| run: | | |
| echo "✅ Infrastructure deployment completed successfully!" | |
| echo "🎯 Pulumi handled Docker building and infrastructure deployment" | |
| echo "🚀 Database migrations run automatically via ECS init container" | |
| echo "" | |
| echo "🌐 Application URL:" | |
| cd apps/infra | |
| pulumi stack output url |