diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..1664ea0 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -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 }} diff --git a/README.md b/README.md index 3083798..f309f6e 100644 --- a/README.md +++ b/README.md @@ -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` diff --git a/docs/api.md b/docs/api.md index db48cf5..bacb4b7 100644 --- a/docs/api.md +++ b/docs/api.md @@ -2,7 +2,7 @@ ## Base URL -``` +```text http://localhost:3000/api/v1 ``` @@ -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, @@ -45,8 +43,6 @@ POST /analyze } ``` -##### Error Response - ```json { "success": false, @@ -62,8 +58,6 @@ Check if the API is running and healthy. GET /health ``` -#### Response - ```json { "success": true,