Skip to content

ci : updates

ci : updates #4

Workflow file for this run

name: 🏓 backend-cd
# on:
# push:
# branches:
# - main
on:
push:
branches:
- main
pull_request:
branches:
- main
defaults:
run:
working-directory: ./backend
env:
CONTAINER_NAME: arunavabasu03/radisapp_backend
REGION: us-east1
REPO_NAME: nextjs-cloud-run
jobs:
backend-deploy:
name: 🚀 Deploy to production
runs-on: ubuntu-latest
steps:
# checkout github repo
- name: Check out Git repository
uses: actions/checkout@v3
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: arunavabasu03
password: ${{ secrets.DOCKER_PASSWORD }}
- uses: "google-github-actions/auth@v2"
with:
credentials_json: "${{ secrets.CLOUD_RUN_SERVICE_ACCOUNT }}"
- name: Build and push Docker image
run: |
cd backend && docker build -t $CONTAINER_NAME:${{ github.sha }} -t $CONTAINER_NAME:latest .
docker push $CONTAINER_NAME:${{ github.sha }}
docker push $CONTAINER_NAME:latest
- name: "Set up Cloud SDK"
uses: "google-github-actions/setup-gcloud@v2"
- name: Deploy to Cloud Run
run: |
gcloud run deploy $REPO_NAME \
--region $REGION \
--image $CONTAINER_NAME:latest\
--platform "managed" \
--quiet