Add GET /cases/resolve identifier-to-cases endpoint #85
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 Staging | |
| on: | |
| push: | |
| branches: [main] | |
| concurrency: | |
| group: deploy-stage | |
| cancel-in-progress: true | |
| env: | |
| REGISTRY: ghcr.io | |
| IMAGE_NAME: ${{ github.repository }} | |
| jobs: | |
| test: | |
| name: Run Tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Install dependencies | |
| run: | | |
| pip install --upgrade pip | |
| pip install -e ".[dev]" | |
| - name: Run tests | |
| env: | |
| USE_SSH_TUNNEL: "false" | |
| DATABASE_URL: "sqlite:///:memory:" | |
| run: python -m pytest tests/ -v --tb=short | |
| build-and-deploy: | |
| name: Build & Deploy to Staging | |
| needs: test | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Log in to GHCR | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build and push Docker image | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| file: deploy/docker/Dockerfile | |
| push: true | |
| build-args: | | |
| APP_VERSION=stage-${{ github.sha }} | |
| GIT_COMMIT=${{ github.sha }} | |
| tags: | | |
| ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:stage | |
| ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:stage-${{ github.sha }} | |
| - name: Deploy to staging server | |
| uses: appleboy/ssh-action@v1 | |
| with: | |
| host: ${{ secrets.STAGE_SSH_HOST }} | |
| username: ec2-user | |
| key: ${{ secrets.STAGE_SSH_KEY }} | |
| script: | | |
| export IMAGE_TAG="stage-${{ github.sha }}" | |
| export GITHUB_REPOSITORY_OWNER="${{ github.repository_owner }}" | |
| bash /home/ec2-user/api/deploy.sh | |
| - name: Verify deployment | |
| uses: appleboy/ssh-action@v1 | |
| with: | |
| host: ${{ secrets.STAGE_SSH_HOST }} | |
| username: ec2-user | |
| key: ${{ secrets.STAGE_SSH_KEY }} | |
| script: bash /home/ec2-user/api/health-check.sh http://localhost:8000 |