File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed
Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -100,6 +100,30 @@ jobs:
100100 echo "Green slot already exists"
101101 fi
102102
103+ # ------------------- Determine Idle Slot -------------------
104+ - name : Determine Idle Slot
105+ id : idle-slot
106+ run : |
107+ RESOURCE_GROUP=${{ secrets.AZURE_RESOURCE_GROUP }}
108+ APP_NAME=${{ secrets.AZURE_APP_NAME }}
109+
110+ PROD_IMAGE=$(az webapp config container show \
111+ --name $APP_NAME \
112+ --resource-group $RESOURCE_GROUP \
113+ --query "linuxFxVersion" -o tsv)
114+
115+ SLOT_BLUE_IMAGE=$(az webapp config container show --name $APP_NAME --resource-group $RESOURCE_GROUP --slot blue --query "linuxFxVersion" -o tsv)
116+ SLOT_GREEN_IMAGE=$(az webapp config container show --name $APP_NAME --resource-group $RESOURCE_GROUP --slot green --query "linuxFxVersion" -o tsv)
117+
118+ if [[ "$SLOT_BLUE_IMAGE" == "$PROD_IMAGE" ]]; then
119+ IDLE_SLOT="green"
120+ else
121+ IDLE_SLOT="blue"
122+ fi
123+
124+ echo "slot_name=$IDLE_SLOT" >> $GITHUB_ENV
125+ echo "Idle slot chosen: $IDLE_SLOT"
126+
103127 # ------------------- Deploy to Idle Slot -------------------
104128 - name : Deploy to Idle Slot
105129 run : |
You can’t perform that action at this time.
0 commit comments