Skip to content

Commit b8e45b6

Browse files
committed
Adds frontend github actions
This just tests a build/lint process. We're using github actions for all new ones so we can do conditional/iterate faster.
1 parent fb0ebb8 commit b8e45b6

File tree

1 file changed

+54
-0
lines changed

1 file changed

+54
-0
lines changed
+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
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 backend/ 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+
build:
38+
runs-on: ubuntu-latest
39+
defaults:
40+
run:
41+
working-directory: ui
42+
strategy:
43+
matrix:
44+
node-version: [16.x]
45+
steps:
46+
- uses: actions/checkout@v3
47+
- name: Use Node.js ${{ matrix.node-version }}
48+
uses: actions/setup-node@v1
49+
with:
50+
node-version: ${{ matrix.node-version }}
51+
- run: npm install --ignore-scripts
52+
- run: npm run build
53+
- run: npm run lint:fix
54+
- run: npm run format:fix

0 commit comments

Comments
 (0)