From a06cd7c6350555f92a3fd3ca9a40a86ae5459098 Mon Sep 17 00:00:00 2001 From: Ashwin Kumar Date: Thu, 12 Mar 2026 00:05:31 +0100 Subject: [PATCH] ci(gitops): trigger app build workflows on gitops pushes --- .../trigger-app-builds-from-gitops.yml | 83 +++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 .github/workflows/trigger-app-builds-from-gitops.yml diff --git a/.github/workflows/trigger-app-builds-from-gitops.yml b/.github/workflows/trigger-app-builds-from-gitops.yml new file mode 100644 index 0000000..e96a85d --- /dev/null +++ b/.github/workflows/trigger-app-builds-from-gitops.yml @@ -0,0 +1,83 @@ +name: Trigger App Builds From GitOps + +on: + push: + branches: + - main + - testingcodex + paths: + - apps/nxtgauge-backend/** + - apps/nxtgauge-admin-frontend/** + - apps/nxtgauge-frontendwebsite/** + +permissions: + contents: read + +jobs: + detect-changes: + if: ${{ github.actor != 'github-actions[bot]' && !startsWith(github.event.head_commit.message, 'chore(gitops): update ') }} + runs-on: ubuntu-latest + outputs: + backend: ${{ steps.filter.outputs.backend }} + admin: ${{ steps.filter.outputs.admin }} + public: ${{ steps.filter.outputs.public }} + steps: + - name: Checkout GitOps repo + uses: actions/checkout@v4 + + - name: Detect changed app paths + id: filter + uses: dorny/paths-filter@v3 + with: + filters: | + backend: + - 'apps/nxtgauge-backend/**' + admin: + - 'apps/nxtgauge-admin-frontend/**' + public: + - 'apps/nxtgauge-frontendwebsite/**' + + trigger-backend: + needs: detect-changes + if: ${{ needs.detect-changes.outputs.backend == 'true' }} + runs-on: ubuntu-latest + steps: + - name: Trigger backend workflow + env: + TOKEN: ${{ secrets.GITOPS_PAT }} + run: | + curl -sS -X POST \ + -H "Accept: application/vnd.github+json" \ + -H "Authorization: Bearer ${TOKEN}" \ + https://api.github.com/repos/Traceworks2023/nxtgauge-nov-2025-backend/actions/workflows/build-and-push-ghcr.yml/dispatches \ + -d '{"ref":"testingcodex"}' + + trigger-admin-frontend: + needs: detect-changes + if: ${{ needs.detect-changes.outputs.admin == 'true' }} + runs-on: ubuntu-latest + steps: + - name: Trigger admin frontend workflow + env: + TOKEN: ${{ secrets.GITOPS_PAT }} + run: | + curl -sS -X POST \ + -H "Accept: application/vnd.github+json" \ + -H "Authorization: Bearer ${TOKEN}" \ + https://api.github.com/repos/Traceworks2023/nxtgauge-nov-2025-frontend/actions/workflows/build-push-and-update-gitops.yml/dispatches \ + -d '{"ref":"testingcodex"}' + + trigger-public-frontend: + needs: detect-changes + if: ${{ needs.detect-changes.outputs.public == 'true' }} + runs-on: ubuntu-latest + steps: + - name: Trigger public frontend workflow + env: + TOKEN: ${{ secrets.GITOPS_PAT }} + run: | + curl -sS -X POST \ + -H "Accept: application/vnd.github+json" \ + -H "Authorization: Bearer ${TOKEN}" \ + https://api.github.com/repos/Traceworks2023/nxtgauge-frontendwebsite/actions/workflows/build-push-and-update-gitops.yml/dispatches \ + -d '{"ref":"testingcodex"}'