Merge pull request #126 from AaronSosaRamos/writing-feedback-generato… #8
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 Cloud Run | |
env: | |
SERVICE_NAME: marvel-ai-backend-sandbox | |
PROJECT_ID: kai-platform-sandbox | |
DOCKER_IMAGE_URL: us-central1-docker.pkg.dev/kai-platform-sandbox/marvel-ai-backend-sandbox/marvel-ai-backend-sandbox | |
on: | |
push: | |
branches: | |
- Develop | |
jobs: | |
dockerize-and-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Google Cloud Auth | |
uses: 'google-github-actions/auth@v2' | |
with: | |
credentials_json: '${{ secrets.SANDBOX_CREDENTIALS }}' | |
project_id: ${{ env.PROJECT_ID }} | |
- name: Set up Cloud SDK | |
uses: 'google-github-actions/setup-gcloud@v2' | |
- name: Configure Docker | |
run: | | |
gcloud auth configure-docker us-central1-docker.pkg.dev | |
- name: Build and Push Docker Image | |
run: | | |
docker build -t ${{ env.DOCKER_IMAGE_URL }}:latest -f Dockerfile . | |
docker push ${{ env.DOCKER_IMAGE_URL }}:latest | |
- name: Deploy to Cloud Run | |
run: | | |
echo SERVICE_NAME $SERVICE_NAME | |
gcloud run deploy $SERVICE_NAME \ | |
--image ${{ env.DOCKER_IMAGE_URL }}:latest \ | |
--platform managed \ | |
--region us-east1 \ | |
--allow-unauthenticated |