Skip to content

Commit 2ead815

Browse files
committed
Update documentation for GitHub Actions workflows
- Change reusable workflow reference from reusable-docker-build.yml to docker-build.yml - Add `prepare` job for version resolution and define default version in `env` - Update parameters to include `version_tag` and pass it to Dockerfile via `build_args` - Clarify that images are only pushed to GHCR from the master branch
1 parent f28a29f commit 2ead815

File tree

4 files changed

+96
-3
lines changed

4 files changed

+96
-3
lines changed

.cursor/rules/adding-new-images.mdc

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,14 @@ Images published as: `ghcr.io/jethome-iot/jethome-dev-<image-name>`
5050
## GitHub Actions Workflow
5151

5252
Create `.github/workflows/<image-name>.yml`:
53-
- Use reusable workflow: `.github/workflows/reusable-docker-build.yml`
53+
- Use reusable workflow: `.github/workflows/docker-build.yml`
5454
- Set triggers for image directory and workflow file changes
55-
- Pass `image_name` and `context_path` parameters
56-
- Include manual trigger and monthly rebuild schedule
55+
- Define default version in `env` section
56+
- Add `prepare` job to resolve versions
57+
- Pass `image_name`, `context_path`, and `version_tag` parameters
58+
- Pass version to Dockerfile via `build_args`
59+
- Include manual trigger with required version input
60+
- Images only pushed to GHCR from master branch
5761
- Test locally with `act -j build -W .github/workflows/<image-name>.yml --dryrun`
5862

5963
## Testing

.cursor/rules/commit-conventions.mdc

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,84 @@ Use clear, descriptive commit messages that explain **what** and **why**.
1818
Good: `Add new development image` with detailed list
1919
Bad: `Update files`, `Fix`, `WIP`, `changes`
2020

21+
## Message Generation Guidelines
22+
23+
When generating commit messages, analyze the actual changes:
24+
25+
### Documentation-Only Changes
26+
27+
If ONLY documentation files changed (README.md, .mdc files):
28+
29+
```
30+
Update documentation for <feature/component>
31+
32+
- Update <specific doc> to reflect <change>
33+
- Add <new information> to <doc>
34+
- Fix outdated <information> in <doc>
35+
```
36+
37+
Example:
38+
```
39+
Update documentation for workflow changes
40+
41+
- Update adding-new-images.mdc with prepare job pattern
42+
- Add PIO_VERSION to platformio README
43+
- Update project structure with scripts/ directory
44+
```
45+
46+
### Code-Only Changes
47+
48+
If ONLY code/workflow files changed:
49+
50+
```
51+
<Action> <component/feature>
52+
53+
- Detailed code change 1
54+
- Detailed code change 2
55+
```
56+
57+
Example:
58+
```
59+
Add version tag parameter to workflows
60+
61+
- Add version_tag to docker-build.yml
62+
- Implement prepare job for version resolution
63+
- Pass versions via build_args
64+
```
65+
66+
### Mixed Changes (Code + Docs)
67+
68+
If BOTH code AND documentation changed together:
69+
70+
```
71+
<Action> <component/feature>
72+
73+
Code changes:
74+
- Code change 1
75+
- Code change 2
76+
77+
Documentation:
78+
- Doc update 1
79+
- Doc update 2
80+
```
81+
82+
### Change Type Detection
83+
84+
Analyze changed files to determine type:
85+
86+
**Documentation files:**
87+
- `*.md` (README files)
88+
- `*.mdc` (Cursor rules)
89+
- Files in `.cursor/rules/`
90+
91+
**Code files:**
92+
- `Dockerfile`
93+
- `*.yml` (workflows)
94+
- `*.sh` (scripts)
95+
- Source code files
96+
97+
**Accurate classification is critical** - don't claim code changes if only docs changed!
98+
2199
## AI/Cursor Commit Policy
22100

23101
**🚫 NEVER AUTO-COMMIT**

.cursor/rules/project-structure.mdc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,19 @@ Multi-image Docker project providing development environments for embedded syste
99

1010
```
1111
jethome-dev/
12+
├── .github/
13+
│ └── workflows/ # GitHub Actions workflows
14+
│ ├── docker-build.yml # Reusable Docker build workflow
15+
│ ├── esp-idf.yml # ESP-IDF image workflow
16+
│ └── platformio.yml # PlatformIO image workflow
1217
├── images/
1318
│ └── <image-name>/ # Each image in its own directory
1419
│ ├── Dockerfile # Image definition
1520
│ ├── README.md # Detailed image documentation
1621
│ └── ... # Supporting files
22+
├── scripts/
23+
│ ├── build.sh # Local image build helper
24+
│ └── test-workflow.sh # Workflow testing with act
1725
├── .cursor/rules/ # Cursor AI rules
1826
├── LICENSE # MIT License
1927
└── README.md # Root README (minimal, generic)

images/platformio/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,13 +219,15 @@ docker build -t jethome-dev-platformio .
219219

220220
```bash
221221
docker build \
222+
--build-arg PIO_VERSION=6.1.18 \
222223
--build-arg ESP32_PLATFORM_VERSION=6.11.0 \
223224
--build-arg NATIVE_PLATFORM_VERSION=1.2.1 \
224225
--build-arg UNITY_VERSION=2.6.0 \
225226
-t jethome-dev-platformio .
226227
```
227228

228229
Available build arguments:
230+
- `PIO_VERSION` - PlatformIO Core version (default: 6.1.18)
229231
- `ESP32_PLATFORM_VERSION` - Espressif32 platform version (default: 6.11.0)
230232
- `NATIVE_PLATFORM_VERSION` - Native platform version (default: 1.2.1)
231233
- `UNITY_VERSION` - Unity test framework version (default: 2.6.0)
@@ -236,6 +238,7 @@ Available build arguments:
236238
| Component | Version | Notes |
237239
|-----------|---------|-------|
238240
| Base Image | Python 3.11 slim | Debian Bookworm |
241+
| PlatformIO Core | 6.1.18 | Latest stable release |
239242
| ESP32 Platform | 6.11.0 | Version 6.12.0 has compatibility issues |
240243
| Native Platform | 1.2.1 | For unit testing |
241244
| Unity Framework | 2.6.0 | Globally installed |

0 commit comments

Comments
 (0)