-
Notifications
You must be signed in to change notification settings - Fork 7
48 lines (44 loc) · 1.64 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
name: Main Workflow
on:
pull_request:
branches:
- main
jobs:
choose-workflow:
runs-on: ubuntu-latest
outputs:
frontend: ${{ steps.set_frontend.outputs.frontend }}
backend: ${{ steps.set_backend.outputs.backend }}
steps:
- name: Set up Frontend
id: set_frontend
run: echo "::set-output name=frontend::false"
- name: Set up Backend
id: set_backend
run: echo "::set-output name=backend::false"
- name: Check for frontend changes
id: check_frontend_changes
run: |
# Check if there are changes in the frontend folder
if git diff --name-only ${{ github.event.before }} ${{ github.sha }} | grep -qE '^apps/portal'; then
echo "::set-output name=frontend::true"
fi
- name: Check for backend changes
id: check_backend_changes
run: |
# Check if there are changes in the backend folder
if git diff --name-only ${{ github.event.before }} ${{ github.sha }} | grep -qE '^apps/api'; then
echo "::set-output name=backend::true"
fi
run-workflows:
needs: choose-workflow
runs-on: ubuntu-latest
steps:
- name: Run Frontend Workflow
if: needs.choose-workflow.outputs.frontend == 'true'
run: echo "Run Frontend Workflow"
# You can replace the echo command with the actual command to trigger the frontend workflow
- name: Run Backend Workflow
if: needs.choose-workflow.outputs.backend == 'true'
run: echo "Run Backend Workflow"
# You can replace the echo command with the actual command to trigger the backend workflow