From e50688fb60f18bb2526826a6b341ce2f2b518afd Mon Sep 17 00:00:00 2001 From: iyoubee Date: Fri, 7 Jun 2024 08:49:08 +0700 Subject: [PATCH] try to fix --- .github/workflows/deploy.yml | 64 +++++++++++++++++------------------ Dockerfile | 3 ++ requirements.txt | Bin 2028 -> 2080 bytes 3 files changed, 35 insertions(+), 32 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 61dbf98..02f68b0 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -50,41 +50,41 @@ jobs: run: | gcloud --quiet auth configure-docker $GCP_REGION-docker.pkg.dev - - name: Run file download script - run: python download.py + # - name: Run file download script + # run: python download.py - name: Build and push Docker image run: | docker build -t $GCP_REGION-docker.pkg.dev/$GCP_PROJECT_ID/ulascan/$APP_NAME:latest . docker push $GCP_REGION-docker.pkg.dev/$GCP_PROJECT_ID/ulascan/$APP_NAME:latest - deploy: - needs: build - runs-on: ubuntu-latest - - steps: - - name: Install SSH client - run: sudo apt-get install -y ssh - - - name: Set up SSH - run: | - echo "$SSH_PRIVATE_KEY" > ssh_key - chmod 600 ssh_key - - - name: Deploy to GCE - run: | - ssh -o StrictHostKeyChecking=no \ - -i ssh_key \ - ulascan@$GCE_INSTANCE_IP \ - "gcloud --quiet auth configure-docker $GCP_REGION-docker.pkg.dev \ - && docker pull $GCP_REGION-docker.pkg.dev/$GCP_PROJECT_ID/ulascan/$APP_NAME:latest \ - && docker stop $APP_NAME || true \ - && docker rm --force $APP_NAME || true \ - && docker run -d \ - --name $APP_NAME \ - -p 5000:5000 \ - $GCP_REGION-docker.pkg.dev/$GCP_PROJECT_ID/ulascan/$APP_NAME:latest \ - && docker image prune -f" - - - name: Cleanup SSH key - run: rm ssh_key + # deploy: + # needs: build + # runs-on: ubuntu-latest + + # steps: + # - name: Install SSH client + # run: sudo apt-get install -y ssh + + # - name: Set up SSH + # run: | + # echo "$SSH_PRIVATE_KEY" > ssh_key + # chmod 600 ssh_key + + # - name: Deploy to GCE + # run: | + # ssh -o StrictHostKeyChecking=no \ + # -i ssh_key \ + # ulascan@$GCE_INSTANCE_IP \ + # "gcloud --quiet auth configure-docker $GCP_REGION-docker.pkg.dev \ + # && docker pull $GCP_REGION-docker.pkg.dev/$GCP_PROJECT_ID/ulascan/$APP_NAME:latest \ + # && docker stop $APP_NAME || true \ + # && docker rm --force $APP_NAME || true \ + # && docker run -d \ + # --name $APP_NAME \ + # -p 5000:5000 \ + # $GCP_REGION-docker.pkg.dev/$GCP_PROJECT_ID/ulascan/$APP_NAME:latest \ + # && docker image prune -f" + + # - name: Cleanup SSH key + # run: rm ssh_key diff --git a/Dockerfile b/Dockerfile index e0e11f9..2ccd919 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,6 +7,9 @@ WORKDIR /app # Copy the current directory contents into the container at /app COPY . /app +# Upgrade pip +RUN pip install --upgrade pip + # Install any dependencies specified in requirements.txt RUN pip install -r requirements.txt diff --git a/requirements.txt b/requirements.txt index d95f7a3b447015ba645e1a7c538b2a011dca2661..f36cf31422b9fcb7dd10494f3be1a183f50731f0 100644 GIT binary patch delta 20 bcmaFEzd&F^9vgceLkUAFL(XPLw$+RPM_vXn delta 12 TcmZ1=@P>aw9^2+cY;}wPA-4po