Update requirements.txt #20
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 Run | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Authenticate to Google Cloud | |
uses: google-github-actions/auth@v1 | |
with: | |
credentials_json: ${{ secrets.GCP_SA_KEY }} | |
- name: Set up Google Cloud SDK | |
uses: google-github-actions/setup-gcloud@v1 | |
with: | |
project_id: ${{ secrets.GCP_PROJECT_ID }} | |
install_components: 'gcloud' | |
- name: Configure Docker | |
run: gcloud auth configure-docker us-central1-docker.pkg.dev | |
- name: Build Docker image | |
run: | | |
docker build -t us-central1-docker.pkg.dev/${{ secrets.GCP_PROJECT_ID }}/turbofan-predictive-maintenance/turbofan-predictive-maintenance:$GITHUB_SHA . | |
- name: Push Docker image | |
run: | | |
docker push us-central1-docker.pkg.dev/${{ secrets.GCP_PROJECT_ID }}/turbofan-predictive-maintenance/turbofan-predictive-maintenance:$GITHUB_SHA | |
- name: Deploy to Cloud Run | |
run: | | |
gcloud run deploy nasa-turbofan-predictor-service \ | |
--image us-central1-docker.pkg.dev/${{ secrets.GCP_PROJECT_ID }}/turbofan-predictive-maintenance/turbofan-predictive-maintenance:$GITHUB_SHA \ | |
--platform managed \ | |
--region us-central1 \ | |
--allow-unauthenticated \ | |
--memory=512Mi |