Skip to content

update readme and deploy.yml #3

update readme and deploy.yml

update readme and deploy.yml #3

Workflow file for this run

name: Deploy to Google Cloud Run
on:
workflow_dispatch:
push:
branches:
- main
- dev
jobs:
deploy:
runs-on: ubuntu-latest
steps:
# Step 1: Checkout the repository
- name: Checkout repository
uses: actions/checkout@v4
# Step 2: Set up Google Cloud SDK
- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@v1
with:
project_id: ${{ secrets.GCP_PROJECT_ID }}
service_account_key: ${{ secrets.GCP_SA_KEY }}
export_default_credentials: true
# Step 3: Configure Docker to use the Google Cloud credentials
- name: Configure Docker
run: |
gcloud auth configure-docker
# Step 4: Build the Docker image
- name: Build Docker image
run: |
docker build -t gcr.io/${{ secrets.GCP_PROJECT_ID }}/whatsappllm:$GITHUB_SHA .
# Step 5: Push the Docker image to Google Container Registry
- name: Push Docker image
run: |
docker push gcr.io/${{ secrets.GCP_PROJECT_ID }}/whatsappllm:$GITHUB_SHA
# Step 6: Deploy to Cloud Run
- name: Deploy to Cloud Run
run: |
gcloud run deploy whatsappllm \
--image gcr.io/${{ secrets.GCP_PROJECT_ID }}/whatsappllm:$GITHUB_SHA \
--platform managed \
--region ${{ secrets.GCP_REGION }} \
--allow-unauthenticated