ci(gitops): trigger app build workflows on gitops pushes
This commit is contained in:
parent
c1a48b32e1
commit
a06cd7c635
1 changed files with 83 additions and 0 deletions
83
.github/workflows/trigger-app-builds-from-gitops.yml
vendored
Normal file
83
.github/workflows/trigger-app-builds-from-gitops.yml
vendored
Normal file
|
|
@ -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"}'
|
||||
Loading…
Add table
Reference in a new issue