forked from nicolargo/glances
-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (52 loc) · 1.8 KB
/
Copy pathwebui.yml
File metadata and controls
58 lines (52 loc) · 1.8 KB
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
57
58
name: webui
on:
workflow_call:
jobs:
build:
# continue-on-error: true
timeout-minutes: 10
runs-on: ubuntu-latest
permissions:
contents: write
strategy:
matrix:
# Use LTS version only
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
node-version: [24.x]
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Glances will be build with Node.js ${{ matrix.node-version }}
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
cache-dependency-path: ./glances/outputs/static/package-lock.json
- name: Build Glances WebUI
working-directory: ./glances/outputs/static
run: |
npm ci
npm run build
- name: Commit and push WebUI
env:
CI_COMMIT_MESSAGE: Continuous Integration Build Artifacts
CI_COMMIT_AUTHOR: Continuous Integration
run: |
git config --global user.name "${{ env.CI_COMMIT_AUTHOR }}"
git config --global user.email "glances@nicolargo.com"
git add glances/outputs/static
if git diff --cached --quiet; then
echo "No WebUI changes to commit, skipping push."
exit 0
fi
git commit -m "${{ env.CI_COMMIT_MESSAGE }}"
for attempt in 1 2 3; do
if git pull --rebase origin "${GITHUB_REF_NAME}" && git push; then
echo "Push succeeded on attempt ${attempt}."
exit 0
fi
echo "Push attempt ${attempt} failed, retrying in $((attempt * 5))s..."
git rebase --abort 2>/dev/null || true
sleep $((attempt * 5))
done
echo "Push failed after 3 attempts."
exit 1