-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (50 loc) · 1.52 KB
/
test-deploy.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
49
50
51
52
53
54
55
56
name: Test deploy
on:
workflow_dispatch:
push:
branches:
- '**'
jobs:
detect_changes:
runs-on: ubuntu-latest
outputs:
api_changed: ${{ steps.changes.outputs.api }}
client_changed: ${{ steps.changes.outputs.client }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Detect changes in client and API paths
uses: dorny/paths-filter@v3
id: changes
with:
base: 'test-0'
initial-fetch-depth: 0
filters: |
client:
- 'client/**'
- '.github/workflows/**'
api:
- 'api/**'
- '.github/workflows/**'
- name: Print detected changes
run: |
echo "Detected changes in the following paths:"
echo "Client changed: ${{ steps.path_filter.outputs.client }}"
echo "API changed: ${{ steps.path_filter.outputs.api }}"
echo "All changes: ${{ steps.path_filter.outputs.changes }}"
build_api:
needs: [detect_changes]
if: ${{ needs.detect_changes.outputs.api_changed == 'true' }}
runs-on: ubuntu-latest
steps:
- name: Build Step
run: echo "Building based on detected API changes."
build_client:
needs: [detect_changes]
if: ${{ needs.detect_changes.outputs.client_changed == 'true' }}
runs-on: ubuntu-latest
steps:
- name: Build Step
run: echo "Building based on detected CLIENT changes."