-
Notifications
You must be signed in to change notification settings - Fork 2
90 lines (76 loc) · 2.74 KB
/
joomengine.yml
File metadata and controls
90 lines (76 loc) · 2.74 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
name: JoomEngine – Automated Build & Version Tracking
on:
repository_dispatch:
types: [ pkg-component-builder-updated ]
workflow_dispatch:
permissions:
contents: write
packages: write
jobs:
build-and-publish:
name: Run ./src/bin/joomengine.sh and track changes
runs-on: ubuntu-latest
steps:
# --------------------------------------------------
# CHECKOUT
# --------------------------------------------------
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
# --------------------------------------------------
# TOOLING
# --------------------------------------------------
- name: Install required tooling
run: |
sudo apt-get update
sudo apt-get install -y \
jq \
xmlstarlet \
gawk \
curl
# --------------------------------------------------
# DOCKER AUTH (CI-ONLY)
# --------------------------------------------------
- name: Authenticate with Docker registry
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
# --------------------------------------------------
# RUN SCRIPT
# --------------------------------------------------
- name: Run ./src/bin/joomengine.sh
run: |
chmod +x ./src/bin/joomengine.sh
./src/bin/joomengine.sh
# --------------------------------------------------
# DETECT CHANGES
# --------------------------------------------------
- name: Detect repository changes
id: git-status
run: |
if [[ -n "$(git status --porcelain)" ]]; then
echo "changed=yes" >> "$GITHUB_OUTPUT"
else
echo "changed=no" >> "$GITHUB_OUTPUT"
fi
# --------------------------------------------------
# COMMIT BACK (ONLY IF NEEDED)
# --------------------------------------------------
- name: Commit and push changes
if: steps.git-status.outputs.changed == 'yes'
run: |
DATE="$(date -u +'%Y-%m-%d')"
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add -A
git commit -m "chore: automated version update (${DATE})"
git push
# --------------------------------------------------
# NO-OP LOG (FOR VISIBILITY)
# --------------------------------------------------
- name: No changes detected
if: steps.git-status.outputs.changed == 'no'
run: |
echo "ℹ️ No repository changes detected — nothing to commit."