83 lines
2.7 KiB
YAML
83 lines
2.7 KiB
YAML
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"}'
|