Skip to content

feat: added sport types #28

feat: added sport types

feat: added sport types #28

Workflow file for this run

name: Deploy to Cloud Run
on:
workflow_dispatch:
push:
branches:
- main
tags:
- "v*"
env:
PROJECT_ID: ${{ secrets.GCP_PROJECT_ID }}
SERVICE_NAME: intania-888-frontend
REGION: asia-southeast1
IMAGE_NAME: gcr.io/${{ secrets.GCP_PROJECT_ID }}/intania-888-frontend
NEXT_PUBLIC_API_BASE_URL: ${{ secrets.NEXT_PUBLIC_API_BASE_URL }}
jobs:
deploy:
name: Build and Deploy
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Google Auth
id: auth
uses: google-github-actions/auth@v2
with:
credentials_json: ${{ secrets.GCP_SA_KEY }}
- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@v2
- name: Configure Docker to use gcloud
run: gcloud auth configure-docker
- name: Build and tag Docker image
run: |
docker build \
--build-arg NEXT_PUBLIC_API_BASE_URL="${{ env.NEXT_PUBLIC_API_BASE_URL }}" \
-t "${{ env.IMAGE_NAME }}:${{ github.sha }}" \
-t "${{ env.IMAGE_NAME }}:latest" \
.
- name: Push Docker image to GCR
run: |
docker push ${{ env.IMAGE_NAME }}:${{ github.sha }}
docker push ${{ env.IMAGE_NAME }}:latest
- name: Deploy to Cloud Run
run: |
gcloud run deploy ${{ env.SERVICE_NAME }} \
--image ${{ env.IMAGE_NAME }}:${{ github.sha }} \
--platform managed \
--region ${{ env.REGION }} \
--allow-unauthenticated \
--set-env-vars="NEXT_PUBLIC_API_BASE_URL=${{ env.NEXT_PUBLIC_API_BASE_URL }}" \
--min-instances=0 \
--max-instances=10 \
--memory=512Mi \
--cpu=1 \
--timeout=300 \
--port=3000
- name: Show deployment URL
run: |
echo "Deployment completed!"
gcloud run services describe ${{ env.SERVICE_NAME }} \
--platform managed \
--region ${{ env.REGION }} \
--format 'value(status.url)'