From 5b8fde9080dc30d2b5c694a4e0b6054287a668ac Mon Sep 17 00:00:00 2001 From: Clayton Smith Date: Tue, 18 Jun 2024 21:26:07 -0400 Subject: [PATCH] fixed deploy --- .github/workflows/deploy_backend.yml | 10 +++++-- .github/workflows/docker_push_frontend.yml | 34 ++++++++++++++++++++++ 2 files changed, 42 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy_backend.yml b/.github/workflows/deploy_backend.yml index 3fbff4a6c4..e708062d34 100644 --- a/.github/workflows/deploy_backend.yml +++ b/.github/workflows/deploy_backend.yml @@ -22,7 +22,7 @@ jobs: id-token: 'write' steps: - - name: Checkout code + - name: Checkout repository uses: actions/checkout@v2 - name: Auth @@ -38,12 +38,18 @@ jobs: - name: Configure Docker run: gcloud auth configure-docker + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v3 + with: + images: ${{ vars.REGISTRY }}/${{ env.IMAGE_NAME }} + # Deploy the image to Cloud Run - name: Deploy to Cloud Run run: | gcloud run deploy ${{ env.IMAGE_NAME }} \ --project=${{ vars.GCP_PROJECT_ID }} \ - --image=${{ env.IMAGE_NAME }}\ + --image=${{ steps.meta.outputs.tags }} \ --platform=managed \ --region=us-central1 \ --allow-unauthenticated \ diff --git a/.github/workflows/docker_push_frontend.yml b/.github/workflows/docker_push_frontend.yml index 95c486b2c5..aa2d90fadf 100644 --- a/.github/workflows/docker_push_frontend.yml +++ b/.github/workflows/docker_push_frontend.yml @@ -45,4 +45,38 @@ jobs: tags: ${{ steps.meta.outputs.tags }} push: true + # - name: Checkout repository + # uses: actions/checkout@v2 + # - name: Auth + # uses: google-github-actions/auth@v1 + # with: + # credentials_json: ${{ secrets.GCP_SA_KEY }} + + # - name: Set up Cloud SDK + # uses: google-github-actions/setup-gcloud@v2 + # with: + # project_id: ${{ secrets.GCP_PROJECT_ID }} + + # - name: Configure Docker + # run: gcloud auth configure-docker + + # - name: Extract metadata (tags, labels) for Docker + # id: meta + # uses: docker/metadata-action@v3 + # with: + # images: ${{ vars.REGISTRY }}/${{ env.IMAGE_NAME }} + + # Deploy the image to Cloud Run + - name: Deploy to Cloud Run + run: | + gcloud run deploy ${{ env.IMAGE_NAME }} \ + --project=${{ vars.GCP_PROJECT_ID }} \ + --image=${{ steps.meta.outputs.tags }} \ + --platform=managed \ + --region=us-central1 \ + --allow-unauthenticated \ + --update-env-vars=DATABASE_URL=${{ secrets.DATABASE_URL }},COHERE_API_KEY=${{ secrets.COHERE_API_KEY }},MINIMAP_API_URL=${{ vars.MINIMAP_API_URL }} \ + --memory=4Gi \ + --cpu=4 \ + --max-instances=1 \ No newline at end of file