File tree 1 file changed +55
-0
lines changed
1 file changed +55
-0
lines changed Original file line number Diff line number Diff line change
1
+ on :
2
+ push :
3
+ branches :
4
+ - main
5
+ paths :
6
+ - ' ui/**'
7
+ pull_request :
8
+ types : [opened, synchronize, reopened]
9
+ paths :
10
+ - ' ui/**'
11
+
12
+ jobs :
13
+ check-changes :
14
+ runs-on : ubuntu-latest
15
+ outputs :
16
+ changes : ${{ steps.filter.outputs.changes }}
17
+ steps :
18
+ - uses : actions/checkout@v3
19
+ with :
20
+ fetch-depth : 2 # fetch previous commit for comparison
21
+ - id : filter
22
+ run : |
23
+ echo "Checking for changes in the frontend directory and branch..."
24
+ # Check if the current branch is not main
25
+ if [[ "${{ github.ref }}" != "refs/heads/main" ]]; then
26
+ # Check for changes in the frontend directory
27
+ if git diff --quiet HEAD^ HEAD -- ui/frontend/; then
28
+ echo "::set-output name=skip::true"
29
+ echo "No changes in frontend/ or not on main branch, skipping subsequent jobs."
30
+ else
31
+ echo "::set-output name=skip::false"
32
+ echo "Changes detected in frontend/ and not on main branch."
33
+ fi
34
+ else
35
+ echo "::set-output name=skip::false"
36
+ echo "On main branch, proceeding with subsequent jobs."
37
+ fi
38
+ build :
39
+ runs-on : ubuntu-latest
40
+ defaults :
41
+ run :
42
+ working-directory : ui
43
+ strategy :
44
+ matrix :
45
+ node-version : [16.x]
46
+ steps :
47
+ - uses : actions/checkout@v3
48
+ - name : Use Node.js ${{ matrix.node-version }}
49
+ uses : actions/setup-node@v1
50
+ with :
51
+ node-version : ${{ matrix.node-version }}
52
+ - run : npm install --ignore-scripts
53
+ - run : npm run build
54
+ - run : npm run lint:fix
55
+ - run : npm run format:fix
You can’t perform that action at this time.
0 commit comments