From 6843a00590dd3f7850d8c26f6f9b143f6330ab9f Mon Sep 17 00:00:00 2001 From: Revanth Date: Mon, 12 May 2025 17:57:16 -0500 Subject: [PATCH 1/3] Added conditional for mesh update --- .github/workflows/deployMesh.yml | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/.github/workflows/deployMesh.yml b/.github/workflows/deployMesh.yml index 892b76f..d7ebfeb 100644 --- a/.github/workflows/deployMesh.yml +++ b/.github/workflows/deployMesh.yml @@ -59,9 +59,19 @@ jobs: cat .env - name: Print AIO CLI Config run: aio config list - - name: Describe - run: aio api-mesh:describe - - name: Get + - name: Get Mesh + id: get_mesh + continue-on-error: true run: aio api-mesh:get - - name: Update + - name: Create Mesh + if: steps.get_mesh.outcome == 'failure' + run: aio api-mesh:create -c mesh.json --env .env + - name: Update Mesh + if: steps.get_mesh.outcome == 'success' run: aio api-mesh:update -c mesh.json --env .env + - name: Wait for 30 seconds + run: sleep 30 + - name: Describe Mesh + run: aio api-mesh:describe + - name: Get Mesh Status + run: aio api-mesh:status From ee91892a18b21143590c0fc70bc3e30479415a5b Mon Sep 17 00:00:00 2001 From: Revanth Date: Mon, 19 May 2025 14:54:19 -0500 Subject: [PATCH 2/3] Updated conditional to check for mesh existance --- .github/workflows/deployMesh.yml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/deployMesh.yml b/.github/workflows/deployMesh.yml index d7ebfeb..5b5507e 100644 --- a/.github/workflows/deployMesh.yml +++ b/.github/workflows/deployMesh.yml @@ -62,12 +62,19 @@ jobs: - name: Get Mesh id: get_mesh continue-on-error: true - run: aio api-mesh:get + run: | + output=$(aio api-mesh:get 2>&1) + # Escape the output and replace newlines with %0A + escaped_output=$(echo "$output" | tr -d '\r' | tr '\n' ' ') + echo "mesh_output=$escaped_output" >> $GITHUB_OUTPUT + echo "$output" + - name: Debug Get Mesh Output + run: echo "Get Mesh Output - ${{ steps.get_mesh.outputs.mesh_output }}" - name: Create Mesh - if: steps.get_mesh.outcome == 'failure' + if: ${{ contains(steps.get_mesh.outputs.mesh_output, 'No mesh found') }} run: aio api-mesh:create -c mesh.json --env .env - name: Update Mesh - if: steps.get_mesh.outcome == 'success' + if: ${{ !contains(steps.get_mesh.outputs.mesh_output, 'No mesh found') }} run: aio api-mesh:update -c mesh.json --env .env - name: Wait for 30 seconds run: sleep 30 From 0802bc439bf8936ec17818c7d694836632ee2690 Mon Sep 17 00:00:00 2001 From: Revanth Date: Mon, 19 May 2025 15:07:21 -0500 Subject: [PATCH 3/3] Run the deploy workflow on push to main --- .github/workflows/deployMesh.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deployMesh.yml b/.github/workflows/deployMesh.yml index 5b5507e..a1bee59 100644 --- a/.github/workflows/deployMesh.yml +++ b/.github/workflows/deployMesh.yml @@ -3,8 +3,8 @@ name: Deploy Mesh # Controls when the workflow will run on: # Triggers the workflow on push or pull request events but only for the "main" branch - # push: - # branches: ["main"] + push: + branches: ["main"] # Allows you to run this workflow manually from the Actions tab workflow_dispatch: