Skip to content

Merge pull request #10 from Adnan-The-Coder/feat/dashboard #9

Merge pull request #10 from Adnan-The-Coder/feat/dashboard

Merge pull request #10 from Adnan-The-Coder/feat/dashboard #9

name: Deploy Python Backend to GCP (Testing stage)
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Authenticate to Google Cloud
uses: google-github-actions/auth@v2
with:
credentials_json: ${{ secrets.GCP_SA_KEY }}
- name: Set up gcloud SDK
uses: google-github-actions/setup-gcloud@v2
with:
project_id: ${{ secrets.GCP_PROJECT_ID }}
- name: Configure Docker for GCP
run: gcloud auth configure-docker
- name: Build & Push Docker Image
run: |
IMAGE=gcr.io/${{ secrets.GCP_PROJECT_ID }}/python-backend
docker build -t $IMAGE:latest apps/python-backend
docker push $IMAGE:latest
- name: Deploy to Cloud Run
run: |
IMAGE=gcr.io/${{ secrets.GCP_PROJECT_ID }}/python-backend:latest
gcloud run deploy python-backend \
--image $IMAGE \
--platform managed \
--region us-central1 \
--allow-unauthenticated \
--memory=1Gi