Created
November 27, 2025 13:55
-
-
Save saviour123/6b47e351d9e04c44268a30a51b922eeb to your computer and use it in GitHub Desktop.
quickie.js
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
| https://moon.mydream42.com/yelizariev/bceb91664910e5eb5bf225c6b22d5fe9/%E2%98%80/AmonRa.markdown |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
#!/bin/bash
Simple deployment script for Google Cloud Run
Usage: ./deploy.sh
set -e
Configuration - Edit these values
PROJECT_ID="hello"
SERVICE_NAME="hello"
REGION="europe-north1"
IMAGE_NAME="gcr.io/${PROJECT_ID}/${SERVICE_NAME}"
Environment variables - Edit these
NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY="hello"
NEXT_PUBLIC_MEDUSA_BACKEND_URL="https://run.app"
Set the project
echo -e "${YELLOW}π§ Setting project to ${PROJECT_ID}${NC}"
gcloud config set project ${PROJECT_ID}
Enable required APIs
echo -e "${YELLOW}π Enabling required APIs...${NC}"
gcloud services enable run.googleapis.com
gcloud services enable containerregistry.googleapis.com
Configure Docker for gcloud
echo -e "${YELLOW}π§ Configuring Docker authentication...${NC}"
gcloud auth configure-docker
Build the Docker image with buildx for AMD64 platform
echo -e "${YELLOW}ποΈ Building Docker image for AMD64 platform...${NC}"
docker buildx build --platform linux/amd64
--build-arg NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY="${NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY}"
--build-arg NEXT_PUBLIC_MEDUSA_BACKEND_URL="${NEXT_PUBLIC_MEDUSA_BACKEND_URL}"
--build-arg MEDUSA_BACKEND_URL="${NEXT_PUBLIC_MEDUSA_BACKEND_URL}"
--build-arg NEXT_PUBLIC_BASE_URL="https://hello.run.app"
--build-arg NEXT_PUBLIC_DEFAULT_REGION="dk"
-t gcr.io/theincheshair/medusa-storefront:latest .
Push the image to Google Container Registry
echo -e "${YELLOW}π€ Pushing image to Google Container Registry...${NC}"
docker push gcr.io/hello/hello-storefront:latest
Deploy to Cloud Run
echo -e "${YELLOW}π’ Deploying to Cloud Run...${NC}"
gcloud run deploy ${SERVICE_NAME}
--image gcr.io/hello/hello
--platform managed
--region ${REGION}
--allow-unauthenticated
--port 8000
--memory 512Mi
--cpu 1
--max-instances 10
--set-env-vars "NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY=${NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY},NEXT_PUBLIC_MEDUSA_BACKEND_URL=${NEXT_PUBLIC_MEDUSA_BACKEND_URL},MEDUSA_BACKEND_URL=https://run.app"
Get the service URL
SERVICE_URL=$(gcloud run services describe ${SERVICE_NAME} --platform managed --region ${REGION} --format 'value(status.url)')
echo ""
echo -e "${GREEN}β Deployment successful!${NC}"
echo -e "${GREEN}π Your app is running at: ${SERVICE_URL}${NC}"
echo ""