Skip to content

feat: Add infrastructure-as-code (IaC) and GitHub Actions workflow #1

feat: Add infrastructure-as-code (IaC) and GitHub Actions workflow

feat: Add infrastructure-as-code (IaC) and GitHub Actions workflow #1

Workflow file for this run

name: Deploy to Cloud Run
on:
push:
branches: [main]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: google-github-actions/setup-gcloud@v0
with:
project_id: ${{ secrets.GCP_PROJECT_ID }}
service_account_key: ${{ secrets.GCP_SA_KEY }}
- name: Authorize Docker to push to Google Container Registry
run: gcloud auth configure-docker
- name: Build and Push Docker Image
run: |
docker build -t gcr.io/${{ secrets.GCP_PROJECT_ID }}/gemini-sre-agent .
docker push gcr.io/${{ secrets.GCP_PROJECT_ID }}/gemini-sre-agent
- name: Deploy to Cloud Run
run: |
gcloud run deploy gemini-sre-agent \
--image gcr.io/${{ secrets.GCP_PROJECT_ID }}/gemini-sre-agent \
--region us-central1 \
--platform managed \
--allow-unauthenticated \
--set-env-vars=GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}