adaptive-lighting/.github
lenucksi 9c7a95f696
fix(ci): fix broken Docker workflow and modernize (#1318)
* fix(ci): fix broken Docker workflow and modernize

## Critical Bug Fixes

1. **Fix broken push condition** (CRITICAL):
   - Old: `push: ${{ github.ref == 'refs/heads/master' }}`
   - Problem: Branch renamed to `main`, so images NEVER pushed
   - New: `push: ${{ github.event_name != 'pull_request' }}`
   - Result: Docker images will actually be published again

2. **Add missing checkout step**:
   - Build was failing because source code wasn't checked out
   - Required for Docker build context

## Modernization Improvements

3. **Migrate to GitHub Container Registry (GHCR)**:
   - Old: DockerHub with `DOCKERHUB_USERNAME` and `DOCKERHUB_TOKEN` secrets
   - New: GHCR with built-in `GITHUB_TOKEN`
   - Benefits: No external account required, better integration

4. **Add semantic versioning**:
   - Automatically tags releases: `v1.2.3`, `v1.2`, `v1`, `latest`
   - Supports version tags (v*), branches, and PRs
   - Uses docker/metadata-action for automatic tagging

5. **Add GitHub Actions caching**:
   - Uses `type=gha` cache for faster builds
   - Reduces build times and GitHub Actions minutes

6. **Security: Digest pinning**:
   - All actions pinned to commit SHAs
   - Prevents supply chain attacks via tag manipulation
   - Follows security best practices

7. **Add explicit permissions**:
   - Minimal required permissions (contents: read, packages: write)
   - Follows principle of least privilege

8. **Add workflow triggers**:
   - Tags (v*) for releases
   - Pull requests for testing
   - Manual dispatch for on-demand builds

## Testing

- Workflow syntax validated
- Push logic tested with different event types
- Compatible with existing Docker build process

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* refactor(ci): simplify docker workflow

- Use version tags instead of SHA pins for readability
- Remove verbose step names (action names are self-documenting)
- Compact YAML formatting
- Fix actions/checkout to v4 (v6 doesn't exist)

---------

Co-authored-by: Bas Nijholt <bas@nijho.lt>
2025-12-12 13:49:45 -08:00
..
ISSUE_TEMPLATE Update bug-report.md (#1046) 2024-10-06 22:42:03 -07:00
workflows fix(ci): fix broken Docker workflow and modernize (#1318) 2025-12-12 13:49:45 -08:00
auto-comment.yml Create auto-comment.yml 2021-08-01 16:43:09 +02:00
CODEOWNERS Release 1.9.1 (#522) 2023-04-03 02:07:05 -07:00
config.yml Create config.yml 2021-08-01 16:41:16 +02:00
FUNDING.yml Fix alias in FUNDING.yml (#677) 2023-07-28 17:20:01 -07:00
release-drafter.yml Add full changelog to releases 2023-08-09 15:01:00 -07:00
renovate.json Add Mend Renovate bot (#1077) 2024-12-05 11:14:08 -08:00
update-services.py [pre-commit.ci] pre-commit autoupdate (#882) 2024-02-05 14:13:13 -08:00
update-strings.py [pre-commit.ci] pre-commit autoupdate (#972) 2025-01-01 23:28:15 -08:00