Skip to content

Commit

Permalink
xdxd
Browse files Browse the repository at this point in the history
  • Loading branch information
CharlyJazz committed Nov 19, 2023
1 parent 0a3611b commit 592d56f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
12 changes: 10 additions & 2 deletions .github/workflows/chat-microservice-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,23 @@ jobs:

- name: Update Deployment Image
run: |
sed -i 's|charlyjazz/chat-microservice:latest|charlyjazz/chat-microservice:${{github.ref_name}}|' ${{env.K8_DIR}}/chat-microservice-deployment.yaml
sed -i 's|${{env.IMAGE}}:latest|${{env.IMAGE}}:${{github.ref_name}}|' ${{env.K8_DIR}}/chat-microservice-deployment.yaml
- name: Deploy to GKE
run: |
kubectl apply -f ${{env.K8_DIR}}/chat-db-volume-persistentvolumeclaim.yaml
kubectl apply -f ${{env.K8_DIR}}/cassandra-deployment.yaml
kubectl apply -f ${{env.K8_DIR}}/cassandra-service.yaml
kubectl apply -f ${{env.K8_DIR}}/chat-microservice-config.yaml
kubectl apply -f ${{env.K8_DIR}}/chat-microservice-deployment.yaml
echo "Apply the deployment and capture the output"
DEPLOYMENT_OUTPUT=$(kubectl apply -f ${{env.K8_DIR}}/chat-microservice-deployment.yaml)
echo "Check if the output contains 'unchanged'"
if echo "$DEPLOYMENT_OUTPUT" | grep -q 'unchanged'; then
echo "Deployment unchanged. Restarting to pick up possible new Docker image..."
kubectl rollout restart deployment/chat-microservice
fi
kubectl apply -f ${{env.K8_DIR}}/chat-microservice-service.yaml
Expand Down
2 changes: 1 addition & 1 deletion chat-microservice/app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ async def shutdown_event():

def create_application() -> FastAPI:
application = FastAPI(title=settings.PROJECT_NAME)
origins = [ "http://localhost:3000" ]
origins = [ "http://localhost:3000", "http://34.69.26.50:3000" ]
application.add_middleware(
CORSMiddleware,
allow_origins=origins,
Expand Down

0 comments on commit 592d56f

Please sign in to comment.