From 9e0f5e8adbef4aed7a53e8ce1933fe08e6e9b881 Mon Sep 17 00:00:00 2001 From: Jade Carino <65225359+jadecarino@users.noreply.github.com> Date: Thu, 1 Aug 2024 14:12:06 +0100 Subject: [PATCH] Add trigger for extensions with GH CLI (#607) * Use new GHCR image Signed-off-by: Jade Carino * Trigger extensions workflow after framework Signed-off-by: Jade Carino * Needs workflow dispatch for trigger Signed-off-by: Jade Carino --------- Signed-off-by: Jade Carino --- .github/workflows/build.yaml | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 6ca7d32db..a67ccec19 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -1,6 +1,7 @@ name: Main build on: + workflow_dispatch: push: branches: [main] @@ -87,7 +88,14 @@ jobs: env: ARGOCD_AUTH_TOKEN: ${{ secrets.ARGOCD_TOKEN }} run: | - docker run --env ARGOCD_AUTH_TOKEN=${{ env.ARGOCD_AUTH_TOKEN }} --rm -v ${{ github.workspace }}:/var/workspace ghcr.io/galasa-dev/argocdcli:main app actions run gh-maven-repos restart --kind Deployment --resource-name framework-gh --server argocd.galasa.dev + docker run --env ARGOCD_AUTH_TOKEN=${{ env.ARGOCD_AUTH_TOKEN }} --rm -v ${{ github.workspace }}:/var/workspace ghcr.io/galasa-dev/argocdcli:main app actions run gh-maven-repos restart --kind Deployment --resource-name framework-gh --server argocd.galasa.dev + + - name: Wait for app health in ArgoCD + env: + ARGOCD_AUTH_TOKEN: ${{ secrets.ARGOCD_TOKEN }} + run: | + docker run --env ARGOCD_AUTH_TOKEN=${{ env.ARGOCD_AUTH_TOKEN }} --rm -v ${{ github.workspace }}:/var/workspace ghcr.io/galasa-dev/argocdcli:main app wait gh-maven-repos --resource apps:Deployment:framework-gh --health --server argocd.galasa.dev + build-rest-api-documentation: name: Build REST API documentation using openapi2beans and gradle @@ -137,4 +145,22 @@ jobs: env: ARGOCD_AUTH_TOKEN: ${{ secrets.ARGOCD_TOKEN }} run: | - docker run --env ARGOCD_AUTH_TOKEN=${{ env.ARGOCD_AUTH_TOKEN }} --rm -v ${{ github.workspace }}:/var/workspace ghcr.io/galasa-dev/argocdcli:main app actions run gh-maven-repos restart --kind Deployment --resource-name restapidocsite-gh --server argocd.galasa.dev + docker run --env ARGOCD_AUTH_TOKEN=${{ env.ARGOCD_AUTH_TOKEN }} --rm -v ${{ github.workspace }}:/var/workspace ghcr.io/galasa-dev/argocdcli:main app actions run gh-maven-repos restart --kind Deployment --resource-name restapidocsite-gh --server argocd.galasa.dev + + - name: Wait for app health in ArgoCD + env: + ARGOCD_AUTH_TOKEN: ${{ secrets.ARGOCD_TOKEN }} + run: | + docker run --env ARGOCD_AUTH_TOKEN=${{ env.ARGOCD_AUTH_TOKEN }} --rm -v ${{ github.workspace }}:/var/workspace ghcr.io/galasa-dev/argocdcli:main app wait gh-maven-repos --resource apps:Deployment:restapidocsite-gh --health --server argocd.galasa.dev + + trigger-extensions-workflow: + name: Trigger Extensions workflow + runs-on: ubuntu-latest + needs: [build-framework, build-rest-api-documentation] + + steps: + - name: Trigger Extensions workflow dispatch event with GitHub CLI + env: + GH_TOKEN: ${{ secrets.GALASA_TEAM_GITHUB_TOKEN }} + run: | + gh workflow run build.yaml --repo https://github.com/galasa-dev/extensions \ No newline at end of file