fix(render): move migrations to buildCommand, add stderr capture #6
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 | |
| on: | |
| push: | |
| branches: [main] | |
| permissions: | |
| contents: read | |
| jobs: | |
| build-and-push: | |
| name: Build & push images | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Log in to registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build & push backend | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: ./backend | |
| push: true | |
| tags: ghcr.io/${{ github.repository }}/backend:${{ github.sha }},ghcr.io/${{ github.repository }}/backend:latest | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| - name: Build & push frontend | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: . | |
| file: frontend.Dockerfile | |
| push: true | |
| tags: ghcr.io/${{ github.repository }}/frontend:${{ github.sha }},ghcr.io/${{ github.repository }}/frontend:latest | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| deploy-staging: | |
| name: Deploy to staging | |
| needs: build-and-push | |
| runs-on: ubuntu-latest | |
| environment: staging | |
| steps: | |
| - name: Deploy backend | |
| run: echo "Deploy backend image to staging — configure your platform here" | |
| - name: Run migrations | |
| run: echo "alembic upgrade head — run in staging container" | |
| - name: Smoke test | |
| run: | | |
| sleep 10 | |
| curl -f https://api-staging.archmind.io/api/health || exit 1 | |
| deploy-prod: | |
| name: Deploy to production | |
| needs: deploy-staging | |
| runs-on: ubuntu-latest | |
| environment: production | |
| steps: | |
| - name: Blue-green deploy | |
| run: echo "Flip prod traffic to new image — configure your platform here" |