This repository has been archived by the owner on Nov 15, 2024. It is now read-only.
fix: handle for given water object #18
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy to Google Cloud | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
deploy: | |
name: Deploy | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Authenticate with Google Cloud | |
uses: google-github-actions/auth@v2 | |
with: | |
credentials_json: ${{ secrets.GCP_SA_KEY }} | |
- name: Set up Google Cloud SDK | |
uses: google-github-actions/setup-gcloud@v2 | |
with: | |
project_id: c241-ps478 | |
- name: Download models | |
run: gcloud storage cp -r gs://waterwise/models/* models/ | |
- name: Build Docker image | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
file: ./Dockerfile | |
push: false | |
tags: asia-east1-docker.pkg.dev/c241-ps478/waterwise/ml-service:latest | |
- name: Push to Google Artifact Registry | |
run: | | |
gcloud auth configure-docker asia-east1-docker.pkg.dev | |
docker push asia-east1-docker.pkg.dev/c241-ps478/waterwise/ml-service:latest | |
- name: Deploy to Google Run | |
run: | | |
gcloud run deploy waterwise-ml \ | |
--image asia-east1-docker.pkg.dev/c241-ps478/waterwise/ml-service:latest \ | |
--region asia-east1 \ | |
--allow-unauthenticated \ | |
--memory 2Gi \ | |
--max-instances 1 \ | |
--port 5000 |