071dd5b647110bcfdd8b86a298cadece568b588b
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>
Gitea Actions Demo Project
A simple Node.js "Hello World" application demonstrating Gitea Actions CI/CD pipeline with Docker build and push.
Project Structure
.
├── .gitea/
│ └── workflows/
│ └── build.yml # Gitea Actions workflow
├── index.js # Main application
├── package.json # Project configuration
├── Dockerfile # Docker image definition
├── .dockerignore # Docker ignore file
└── README.md # This file
Application
The application is a simple Node.js script that prints "Hello World" to the console.
Running Locally
node index.js
Running with Docker
# Build the image
docker build -t gitea-actions-demo-project:1.0.0 .
# Run the container
docker run gitea-actions-demo-project:1.0.0
Gitea Actions CI/CD Pipeline
The project includes a Gitea Actions workflow that automatically:
- Triggers on push to
masterormainbranches - Checks out the code
- Reads the version from
package.json - Builds a Docker image
- Pushes the image to
registry.budakova.org/knee-cola/gitea-actions-demo-project:<version> - Also tags and pushes as
latest
Workflow File
The workflow is defined in .gitea/workflows/build.yml
Registry Authentication
The workflow authenticates to the Docker registry using credentials configured in the repository settings:
- REGISTRY_USERNAME - Action variable defined in repository settings (Settings → Actions → Variables)
- REGISTRY_TOKEN - Action secret defined in repository settings (Settings → Actions → Secrets)
The REGISTRY_TOKEN should be a personal access token created in your Gitea user settings with the write:packages scope.
Image Naming
Images are pushed with two tags:
registry.budakova.org/knee-cola/gitea-actions-demo-project:<version-from-package.json>registry.budakova.org/knee-cola/gitea-actions-demo-project:latest
Updating the Version
To change the version of your Docker image, simply update the version field in package.json. The next push to master/main will build and push the new version.
Testing the Workflow
- Make a change to the code or update the version in
package.json - Commit and push to master/main branch
- Check the Actions tab in your Gitea repository to see the workflow running
- Once complete, your Docker image will be available at the registry
Description
Languages
Dockerfile
82.4%
JavaScript
17.6%