Skip to content

Commit 76bc589

Browse files
committed
Trigger deploy2
1 parent 88a92bc commit 76bc589

3 files changed

Lines changed: 49 additions & 0 deletions

File tree

.github/workflows/ci-docker.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ on:
55
branches:
66
- main
77
- lorenc-ci
8+
- paython-mcp
9+
- feature/configure-chat-ui
810
pull_request:
911
branches:
1012
- main
@@ -69,3 +71,47 @@ jobs:
6971
run: |
7072
docker push $IMAGE_ID:$VERSION
7173
docker push $IMAGE_ID:latest
74+
75+
deploy-gcp:
76+
needs: docker-image
77+
runs-on: ubuntu-latest
78+
79+
steps:
80+
- name: Checkout repository
81+
uses: actions/checkout@v4
82+
83+
- name: Set up gcloud
84+
uses: google-github-actions/setup-gcloud@v2
85+
with:
86+
service_account_key: ${{ secrets.GCP_SERVICE_ACCOUNT_KEY }}
87+
project_id: ${{ secrets.GCP_PROJECT_ID }}
88+
export_default_credentials: true
89+
90+
- name: Configure Docker for Artifact Registry
91+
run: |
92+
gcloud auth configure-docker us-east1-docker.pkg.dev
93+
94+
- name: Pull image from GHCR
95+
run: |
96+
IMAGE_ID=ghcr.io/${{ github.repository_owner }}/mcp-backend
97+
VERSION=${{ github.sha }}
98+
echo "IMAGE_ID=$IMAGE_ID" >> $GITHUB_ENV
99+
echo "VERSION=$VERSION" >> $GITHUB_ENV
100+
echo "$GITHUB_TOKEN" | docker login ghcr.io -u "$GITHUB_ACTOR" --password-stdin
101+
docker pull $IMAGE_ID:$VERSION
102+
103+
- name: Tag and push image to Artifact Registry
104+
run: |
105+
AR_IMAGE=us-east1-docker.pkg.dev/${{ secrets.GCP_PROJECT_ID }}/mcp-backend/mcp-backend
106+
docker tag ghcr.io/${{ github.repository_owner }}/mcp-backend:${{ github.sha }} $AR_IMAGE:${{ github.sha }}
107+
docker push $AR_IMAGE:${{ github.sha }}
108+
echo "AR_IMAGE=$AR_IMAGE" >> $GITHUB_ENV
109+
110+
- name: Deploy to Cloud Run
111+
run: |
112+
gcloud run deploy mcp-backend \
113+
--image $AR_IMAGE:${{ github.sha }} \
114+
--region ${{ secrets.GCP_REGION }} \
115+
--platform managed \
116+
--allow-unauthenticated \
117+
--port 3000

.github/workflows/ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ on:
44
branches:
55
- main
66
- lorenc-ci
7+
- paython-mcp
8+
- feature/configure-chat-ui
79

810
workflow_dispatch:
911
inputs:

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ ALTER TABLE public.deployment_logs
195195
└──────────────────────────┘
196196
197197
Adding this line to test the workflows
198+
Another test
198199
199200
Test
200201
```

0 commit comments

Comments
 (0)