Stub implementation of local analysis #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: Test and Deploy | |
| on: push | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: astral-sh/setup-uv@v5 | |
| - name: install dependencies | |
| run: | | |
| uv sync | |
| - name: run tests | |
| env: | |
| OPEN_AI_KEY: ${{ secrets.OPEN_AI_KEY }} | |
| RUN_SLOW_TESTS: "true" | |
| run: | | |
| uv run -m unittest | |
| build: | |
| runs-on: ubuntu-latest | |
| needs: [ test ] | |
| permissions: | |
| contents: "read" | |
| id-token: "write" | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: google-github-actions/auth@v2 | |
| with: | |
| workload_identity_provider: "${{ vars.GCP_WORKLOAD_IDENTITY_POOL_ID }}" | |
| service_account: "${{ vars.GCP_SERVICE_ACCOUNT }}" | |
| - uses: google-github-actions/setup-gcloud@v2 | |
| - uses: astral-sh/setup-uv@v5 | |
| - name: build | |
| run: | | |
| uv pip compile pyproject.toml -o requirements.txt | |
| gcloud builds submit --tag gcr.io/${{ vars.GCP_PROJECT_ID }}/repository-discovery/app:${{ github.sha }} | |
| deploy: | |
| runs-on: ubuntu-latest | |
| needs: [ build ] | |
| permissions: | |
| contents: "read" | |
| id-token: "write" | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: google-github-actions/auth@v2 | |
| with: | |
| workload_identity_provider: "${{ vars.GCP_WORKLOAD_IDENTITY_POOL_ID }}" | |
| service_account: "${{ vars.GCP_SERVICE_ACCOUNT }}" | |
| - uses: google-github-actions/setup-gcloud@v2 | |
| - name: Deploy | |
| uses: google-github-actions/deploy-cloudrun@v2 | |
| with: | |
| service: repository-discovery-app | |
| image: gcr.io/${{ vars.GCP_PROJECT_ID }}/repository-discovery/app:${{ github.sha }} | |
| region: us-central1 | |
| flags: --allow-unauthenticated --platform managed | |
| secrets: | | |
| OPEN_AI_KEY=OPEN_AI_KEY:latest | |
| FLASK_SECRET_KEY=FLASK_SECRET_KEY:latest | |
| GITHUB_CLIENT_SECRET=GITHUB_CLIENT_SECRET:latest | |
| env_vars: | | |
| GITHUB_OAUTH_ENABLED=true | |
| GITHUB_CLIENT_ID=${{ vars.OAUTH_GITHUB_CLIENT_ID }} | |
| ALLOWED_DOMAINS=${{ vars.ALLOWED_DOMAINS }} |