Skip to content

Commit

Permalink
try to fix
Browse files Browse the repository at this point in the history
  • Loading branch information
iyoubee committed Jun 7, 2024
1 parent 37ba73b commit e50688f
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 32 deletions.
64 changes: 32 additions & 32 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Binary file modified requirements.txt
Binary file not shown.

0 comments on commit e50688f

Please sign in to comment.