Skip to content

Commit

Permalink
Add Cloud Run deployment workflow and OpenAI setup in README
Browse files Browse the repository at this point in the history
  • Loading branch information
scald committed Dec 1, 2024
1 parent 8328fc0 commit 12c52e9
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 10 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Deploy to Cloud Run

on:
push:
branches:
- main

env:
PROJECT_ID: eyeris-443322
SERVICE_NAME: eyeris
REGION: us-central1

jobs:
deploy:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Google Auth
id: auth
uses: google-github-actions/auth@v2
with:
workload_identity_provider: ${{ secrets.WIF_PROVIDER }}
service_account: ${{ secrets.WIF_SERVICE_ACCOUNT }}

- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@v2

- name: Authorize Docker push
run: gcloud auth configure-docker

- name: Build and Push Container
run: |-
docker build -t gcr.io/${{ env.PROJECT_ID }}/${{ env.SERVICE_NAME }}:${{ github.sha }} .
docker push gcr.io/${{ env.PROJECT_ID }}/${{ env.SERVICE_NAME }}:${{ github.sha }}
- name: Deploy to Cloud Run
uses: google-github-actions/deploy-cloudrun@v2
with:
service: ${{ env.SERVICE_NAME }}
region: ${{ env.REGION }}
image: gcr.io/${{ env.PROJECT_ID }}/${{ env.SERVICE_NAME }}:${{ github.sha }}
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,19 @@ git clone https://github.com/yourusername/eyeris.git
cd eyeris
```

2. Set up your OpenAI API key:
1. Set up your OpenAI API key:

```bash
export OPENAI_API_KEY='your-api-key-here'
```

3. Build and run:
1. Build and run:

```bash
cargo run
```

4. Access the service:
1. Access the service:

- Web Interface: `http://localhost:3000`
- API Endpoint: `http://localhost:3000/api/v1`
Expand Down
8 changes: 1 addition & 7 deletions docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Base URL

```
```text
http://localhost:3000/api/v1
```

Expand All @@ -28,8 +28,6 @@ POST /analyze
| image | file | form | The image file to analyze |
| model | string | query | (Optional) The model to use for analysis. Default: "gpt-4o" |

#### Response

```json
{
"success": true,
Expand All @@ -45,8 +43,6 @@ POST /analyze
}
```

##### Error Response

```json
{
"success": false,
Expand All @@ -62,8 +58,6 @@ Check if the API is running and healthy.
GET /health
```

#### Response

```json
{
"success": true,
Expand Down

0 comments on commit 12c52e9

Please sign in to comment.