2024-11-23 20:21:44 +01:00
|
|
|
name: UI Build
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
paths:
|
|
|
|
- 'ui/**'
|
|
|
|
pull_request:
|
|
|
|
paths:
|
|
|
|
- 'ui/**'
|
|
|
|
workflow_dispatch:
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build-ui:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
permissions:
|
|
|
|
contents: write
|
|
|
|
pull-requests: write
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v4
|
2024-11-23 21:04:46 +01:00
|
|
|
with:
|
|
|
|
ref: ${{ github.event.pull_request.head.ref }}
|
|
|
|
repository: ${{ github.event.pull_request.head.repo.full_name }}
|
|
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
2024-11-23 20:21:44 +01:00
|
|
|
|
|
|
|
- name: Setup Node.js
|
|
|
|
uses: actions/setup-node@v4
|
|
|
|
with:
|
|
|
|
node-version: '18'
|
|
|
|
cache: 'npm'
|
|
|
|
cache-dependency-path: ui/package-lock.json
|
|
|
|
|
|
|
|
- name: Install Dependencies
|
|
|
|
working-directory: ui
|
|
|
|
run: npm ci
|
|
|
|
|
|
|
|
- name: Build UI
|
|
|
|
working-directory: ui
|
|
|
|
run: npm run build
|
|
|
|
|
2024-11-23 21:04:46 +01:00
|
|
|
- name: Commit changes to PR
|
|
|
|
if: github.event_name == 'pull_request'
|
|
|
|
run: |
|
|
|
|
git config --global user.name 'github-actions[bot]'
|
|
|
|
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
|
2024-12-01 17:40:28 +01:00
|
|
|
git add src/ui_*.h
|
2024-11-23 21:04:46 +01:00
|
|
|
git status --porcelain && git commit -m "chore: update UI build outputs" && git push || echo "No changes to commit"
|
|
|
|
|
2024-11-23 20:21:44 +01:00
|
|
|
- name: Create Pull Request
|
2024-11-23 21:04:46 +01:00
|
|
|
if: github.event_name != 'pull_request'
|
2024-11-26 02:49:46 +01:00
|
|
|
uses: peter-evans/create-pull-request@v7
|
2024-11-23 20:21:44 +01:00
|
|
|
with:
|
|
|
|
commit-message: 'chore: update UI build outputs'
|
|
|
|
title: 'Update UI build outputs'
|
|
|
|
body: |
|
|
|
|
This PR updates the UI build outputs (header files) based on changes in the UI source code.
|
|
|
|
|
|
|
|
Changes were automatically generated by the UI build workflow.
|
|
|
|
branch: update-ui-build
|
|
|
|
delete-branch: true
|
|
|
|
base: master
|
|
|
|
add-paths: |
|
2024-12-01 17:40:28 +01:00
|
|
|
src/ui_*.h
|
2024-11-23 20:21:44 +01:00
|
|
|
labels: |
|
|
|
|
automated pr
|
|
|
|
ui
|