File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Deploy to Cloud Run
2+
3+ env :
4+ SERVICE_NAME : custom-ocr-rag-app
5+ PROJECT_ID : informationextraction-468103
6+ DOCKER_IMAGE_URL : us-west1-docker.pkg.dev/informationextraction-468103/ocr-rag-app-repo/rag-api:latest
7+
8+ on :
9+ push :
10+ branches :
11+ - main
12+ pull_request :
13+ branches :
14+ - main
15+
16+ jobs :
17+ dockerize-and-deploy :
18+ runs-on : ubuntu-latest
19+
20+ steps :
21+ - name : Checkout repository
22+ uses : actions/checkout@v2
23+
24+ - name : Google Cloud Auth
25+ uses : ' google-github-actions/auth@v2'
26+ with :
27+ credentials_json : ' ${{ secrets.GCP_SA_KEY }}'
28+ project_id : ${{ env.PROJECT_ID }}
29+
30+ - name : Set up Cloud SDK
31+ uses : ' google-github-actions/setup-gcloud@v2'
32+
33+ - name : Configure Docker
34+ run : |
35+ gcloud auth configure-docker us-west1-docker.pkg.dev
36+
37+ - name : Build and Push Docker image
38+ run : |
39+ docker build -t ${{ env.DOCKER_IMAGE_URL }}:latest -f Dockerfile.prod .
40+ docker push ${{ env.DOCKER_IMAGE_URL }}:latest
41+
42+ - name : Deploy to Cloud Run
43+ run : |
44+ echo SERVICE_NAME $SERVICE_NAME
45+ gcloud run deploy $SERVICE_NAME \
46+ --image ${{ env.DOCKER_IMAGE_URL }}:latest \
47+ --platform managed \
48+ --region us-west1 \
49+ --allow-unauthenticated
You can’t perform that action at this time.
0 commit comments