15 Commits

Author SHA1 Message Date
Nikola Derežić
4b84d265b6 (refactor) extract version check workflows into reusable components
All checks were successful
Build and Push Docker Image / check_version (push) Successful in 8s
Build and Push Docker Image / check_image_version (push) Successful in 9s
Build and Push Docker Image / build (push) Has been skipped
- Create check_package_version.yml reusable workflow
  - Add workspacePath input for flexible package.json location
  - Fix path concatenation to handle root directory cleanly
  - Expose version_changed and version outputs

- Create check_image_version.yml reusable workflow
  - Add workspacePath, imageName, registryUrl, registryUsername, and registryNamespace inputs
  - Make fully generic and portable across different registries
  - Fix path handling for clean path generation
  - Rename secret to registryToken for clarity

- Update build.yml to use reusable workflows
  - Replace inline jobs with workflow_call references
  - Pass all required parameters explicitly
  - Maintain existing conditional logic in build job

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-09 16:32:31 +01:00
Nikola Derežić
071dd5b647 (feature) add registry image check and workflow documentation
All checks were successful
Build and Push Docker Image / check_version (push) Successful in 7s
Build and Push Docker Image / check_image_version (push) Successful in 9s
Build and Push Docker Image / build (push) Has been skipped
Added check_image_version job that verifies if Docker image already exists in registry using docker manifest inspect. This prevents redundant builds while handling registry cleanup scenarios. Also added explanatory comments above all jobs.

Key changes:
- New check_image_version job runs in parallel with check_version
- Uses docker manifest inspect for lightweight image existence check
- Build now uses OR logic: version changed OR image missing OR PR
- Both check jobs run independently for faster parallel execution
- Added comments explaining each job's purpose and build conditions

Build logic:
- Builds when version changed (new release)
- Builds when image missing from registry (handles cleanup)
- Always builds PRs (validation requirement)
- Skips only when version unchanged AND image exists

Benefits:
- Comprehensive checking of both git history and registry state
- Handles registry cleanup without manual intervention
- Clear documentation of workflow logic
- Parallel job execution for faster workflow runs

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-09 14:36:25 +01:00
Nikola Derežić
a249c599d9 (refactor) restructure workflow into two jobs with dependency
All checks were successful
Build and Push Docker Image / check_version (push) Successful in 8s
Build and Push Docker Image / build (push) Has been skipped
Split the workflow into separate check_version and build jobs using the needs keyword for job dependencies. This improves separation of concerns and makes the workflow structure more explicit.

Key changes:
- Created check_version job that outputs version_changed and version
- Build job now depends on check_version using needs keyword
- Build job uses version from check_version output (no re-reading)
- Added fetch-depth: 0 to ensure full git history for comparison
- Removed duplicate version reading step from build job
- Build conditional now uses needs.check_version.outputs.version_changed

Benefits:
- Clear separation between version checking and build logic
- Version is determined once and reused across jobs
- Better observability with separate job statuses in UI
- Enables potential reuse of version outputs by other jobs

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-09 14:22:35 +01:00
Nikola Derežić
87fe823969 (enhancement) add conditional workflow execution based on version changes
All checks were successful
Build and Push Docker Image / build (push) Has been skipped
The workflow now skips the build job when the version in package.json hasn't changed compared to the previous commit. This prevents unnecessary Docker builds when only non-version changes are pushed.

Key changes:
- Added version-check step to compare current and previous package.json versions
- Added job-level conditional to skip build when version is unchanged
- Pull requests always run to validate version bumps before merge
- Handles edge cases: first commit, missing package.json in history

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-09 13:37:28 +01:00
Nikola Derežić
46781e07a3 (doc) formatting comments
All checks were successful
Build and Push Docker Image / build (push) Successful in 25s
2026-01-09 13:26:39 +01:00
Nikola Derežić
5ace3588cc (bugfix) registry username was not referencing correct variable
All checks were successful
Build and Push Docker Image / build (push) Successful in 26s
2026-01-09 13:14:36 +01:00
Nikola Derežić
5a04696e83 (doc) comenting code
Some checks failed
Build and Push Docker Image / build (push) Failing after 18s
2026-01-09 13:13:07 +01:00
Nikola Derežić
1c62f8dbf7 testing out profile-scope variables & secrets
Some checks failed
Build and Push Docker Image / build (push) Failing after 20s
2026-01-09 13:09:59 +01:00
Nikola Derežić
0a8348458b (bugfix) build.yaml: secret and var wasn't referenced properly
All checks were successful
Build and Push Docker Image / build (push) Successful in 49s
2026-01-09 12:41:15 +01:00
Nikola Derežić
e5cfae67dc (doc) Update README and clean up workflow step name
Some checks failed
Build and Push Docker Image / build (push) Failing after 46s
Updated README to document registry authentication setup using REGISTRY_USERNAME and REGISTRY_TOKEN configured in repo settings. Also removed debug info from workflow step name.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-09 12:37:14 +01:00
Nikola Derežić
6d1e01d73b (fix) fixing registry login by replacing gitea.actor & gitea.token with action variable and action secret
Some checks failed
Build and Push Docker Image / build (push) Failing after 46s
2026-01-09 12:33:26 +01:00
Nikola Derežić
03ad8588c0 (troubleshooting) added gitea.actor and gitea.token to step name
Some checks failed
Build and Push Docker Image / build (push) Failing after 18s
2026-01-09 11:58:39 +01:00
Nikola Derežić
ecf5f635f7 Modified registry authentication to use gitea.ACTOR/gitea.token instead of env variables
Some checks failed
Build and Push Docker Image / build (push) Failing after 19s
2026-01-09 11:54:35 +01:00
Nikola Derežić
8deb647b52 Add registry authentication using Gitea automatic secrets
Some checks failed
Build and Push Docker Image / build (push) Failing after 17s
Use GITEA_ACTOR and GITEA_TOKEN for Docker registry login. These secrets
are automatically provided by Gitea Actions and require no manual
configuration.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-09 11:48:17 +01:00
Nikola Derežić
70e721cc31 Initial commit: Gitea Actions demo project with Docker build
Some checks failed
Build and Push Docker Image / build (push) Failing after 6m27s
Add simple Node.js Hello World application with automated Docker build and
push workflow using Gitea Actions. The workflow builds and pushes images to
the Gitea registry with versioning from package.json.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-09 11:24:17 +01:00