Skip to content

Commit 9e9dc27

Browse files
authored
Merge pull request #1670 from owntone/gh_build_webui
Let Github actions rebuild web UI on push to web-src
2 parents 912e00d + 84042a4 commit 9e9dc27

4 files changed

Lines changed: 75 additions & 7 deletions

File tree

.github/workflows/build_htdocs.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Build htdocs
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
paths:
8+
- 'web-src/**'
9+
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- name: Install dependencies
17+
working-directory: web-src
18+
run: npm install
19+
20+
# Build for production with minification (will update web interface
21+
# in "../htdocs")
22+
- name: Build htdocs
23+
working-directory: web-src
24+
run: npm run build
25+
26+
- name: Count changed files
27+
id: count
28+
run: |
29+
git add htdocs/
30+
git diff --numstat --staged > diffstat
31+
test -s diffstat || { echo "Warning: Push to web-src did not change htdocs"; exit 1; }
32+
33+
# The GH action email is from https://github.com/orgs/community/discussions/26560
34+
- name: Commit and push updated assets
35+
run: |
36+
git config --global user.name "github-actions[bot]"
37+
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
38+
git commit -m "[web] Rebuild web interface"
39+
git push

.github/workflows/codeql-analysis.yml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,19 @@ name: "CodeQL"
22

33
on:
44
push:
5-
branches: [master, ]
5+
branches:
6+
- master
7+
paths-ignore:
8+
- 'docs/**'
9+
- 'htdocs/**'
10+
- 'web-src/**'
611
pull_request:
7-
# The branches below must be a subset of the branches above
8-
branches: [master]
12+
branches:
13+
- master
14+
paths-ignore:
15+
- 'docs/**'
16+
- 'htdocs/**'
17+
- 'web-src/**'
918
schedule:
1019
- cron: '0 19 * * 6'
1120

.github/workflows/macos.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,19 @@ name: MacOS
22

33
on:
44
push:
5-
branches: [ master ]
5+
branches:
6+
- master
7+
paths-ignore:
8+
- 'docs/**'
9+
- 'htdocs/**'
10+
- 'web-src/**'
611
pull_request:
7-
branches: [ master ]
12+
branches:
13+
- master
14+
paths-ignore:
15+
- 'docs/**'
16+
- 'htdocs/**'
17+
- 'web-src/**'
818
workflow_dispatch:
919

1020
jobs:

.github/workflows/ubuntu.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,19 @@ name: Ubuntu
22

33
on:
44
push:
5-
branches: [ master ]
5+
branches:
6+
- master
7+
paths-ignore:
8+
- 'docs/**'
9+
- 'htdocs/**'
10+
- 'web-src/**'
611
pull_request:
7-
branches: [ master ]
12+
branches:
13+
- master
14+
paths-ignore:
15+
- 'docs/**'
16+
- 'htdocs/**'
17+
- 'web-src/**'
818
workflow_dispatch:
919

1020
jobs:

0 commit comments

Comments
 (0)