integrate with UI #7
This file contains hidden or 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: Build and Deploy to Google Cloud Run | |
| on: | |
| push: | |
| branches: | |
| - main # Adjust branch as needed | |
| env: | |
| IMAGE_NAME: os-server # Name of the Docker image | |
| GAR_REPO: os-server # Name of the Artifact Registry repository | |
| REGION: ${{ secrets.REGION }} | |
| SERVICE_NAME: ${{ secrets.SERVICE_NAME }} | |
| PROJECT_ID: ${{ secrets.GCP_PROJECT_ID }} | |
| jobs: | |
| deploy: | |
| name: Build and Deploy | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v4 | |
| - name: Authenticate to Google Cloud | |
| uses: google-github-actions/auth@v2 | |
| with: | |
| credentials_json: ${{ secrets.GCP_SA_KEY }} | |
| - name: Configure Docker | |
| run: | | |
| gcloud auth configure-docker $REGION-docker.pkg.dev | |
| - name: Build and Push Docker Image | |
| run: | | |
| IMAGE_URI="$REGION-docker.pkg.dev/$PROJECT_ID/$GAR_REPO/$IMAGE_NAME:latest" | |
| docker build -t $IMAGE_URI . | |
| docker push $IMAGE_URI | |
| - name: Deploy to Cloud Run | |
| run: | | |
| IMAGE_URI="$REGION-docker.pkg.dev/$PROJECT_ID/$GAR_REPO/$IMAGE_NAME:latest" | |
| gcloud run deploy $SERVICE_NAME \ | |
| --image $IMAGE_URI \ | |
| --region $REGION \ | |
| --platform managed \ | |
| --allow-unauthenticated \ | |
| --port 8000 |