Skip to content

Commit ab80a5f

Browse files
committed
fix: Auto-detect and target resource group for Code Engine
1 parent 7cf65be commit ab80a5f

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

.github/workflows/ibm-code-engine-staging.yml

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,21 @@ jobs:
9393
-r ${{ env.IBM_CLOUD_REGION }}
9494
9595
# -----------------------------------------------------------
96-
# 3️⃣ Select Code Engine project
96+
# 3️⃣ Target resource group
97+
# -----------------------------------------------------------
98+
- name: 🎯 Target resource group
99+
run: |
100+
# List resource groups and target the default one
101+
echo "Available resource groups:"
102+
ibmcloud resource groups
103+
104+
# Get the first resource group (default)
105+
RG_NAME=$(ibmcloud resource groups --output json | jq -r '.[0].name')
106+
echo "Targeting resource group: $RG_NAME"
107+
ibmcloud target -g "$RG_NAME"
108+
109+
# -----------------------------------------------------------
110+
# 4️⃣ Select Code Engine project
97111
# -----------------------------------------------------------
98112
- name: 📂 Select Code Engine project
99113
run: |
@@ -102,7 +116,7 @@ jobs:
102116
ibmcloud code-engine project current
103117
104118
# -----------------------------------------------------------
105-
# 4️⃣ Deploy Backend Application
119+
# 5️⃣ Deploy Backend Application
106120
# -----------------------------------------------------------
107121
- name: 📦 Deploy Backend to Code Engine
108122
id: deploy-backend
@@ -147,7 +161,7 @@ jobs:
147161
echo "✅ Backend deployed: $BACKEND_URL"
148162
149163
# -----------------------------------------------------------
150-
# 5️⃣ Deploy Frontend Application
164+
# 6️⃣ Deploy Frontend Application
151165
# -----------------------------------------------------------
152166
- name: 📦 Deploy Frontend to Code Engine
153167
id: deploy-frontend
@@ -194,7 +208,7 @@ jobs:
194208
echo "✅ Frontend deployed: $FRONTEND_URL"
195209
196210
# -----------------------------------------------------------
197-
# 6️⃣ Health Check
211+
# 7️⃣ Health Check
198212
# -----------------------------------------------------------
199213
- name: 🏥 Run Health Check
200214
run: |

0 commit comments

Comments
 (0)