From 12b00cdc5f38bca767f1761a008aba9c6862c331 Mon Sep 17 00:00:00 2001 From: Sina Date: Tue, 6 Aug 2024 14:12:38 +0330 Subject: [PATCH] updated readme --- README.md | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 58 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 3c40cce..b8fcac5 100644 --- a/README.md +++ b/README.md @@ -1 +1,58 @@ -# container-registry \ No newline at end of file +This repository centralizes all Docker images in one place, simplifying the process of building and pushing Docker images. + +## Purpose + +The primary goal of this repository is to streamline Docker image management by: + +- **Gathering all Docker images**: Consolidates Dockerfiles into a single repository. +- **Automating the build and push process**: Uses GitHub Actions to build and push Docker images based on commit messages. + +## Folder Structure + +Organize your repository as follows to ensure compatibility with the workflow: + +``` +/ + app1/ + Dockerfile + app2/ + Dockerfile +``` + +- Each directory (`app1`, `app2`, etc.) should contain a `Dockerfile`. +- The name of each directory corresponds to the Docker image name. + +## Commit Message Format + +To trigger the Docker build and push process, format your commit messages as follows: + +``` +build/: +``` + +- ``: The directory name containing the `Dockerfile`. +- ``: The version tag for the Docker image. + +### Examples + +1. **Commit Message for `app1` Docker Image with Version 1.0.0**: + ``` + build/app1:1.0.0 + ``` + +2. **Commit Message for `app2` Docker Image with Version 2.1.0**: + + ``` + build/app2:2.1.0 + ``` + +## Workflow Behavior + +- **Valid Commits**: Commits with messages that match the `build/:` format will trigger the Docker image build and push process. +- **Invalid Commits**: Commits not following the specified format will be skipped. The CI process will not build or push Docker images for these commits, ensuring that only relevant updates are processed. +- +## Summary + +By following these conventions, you ensure that Docker images are built and pushed automatically whenever a commit with the correct format is made. This approach helps maintain a well-organized repository and simplifies Docker image management. + +For more information on GitHub Actions and Docker, check out the [GitHub Actions documentation](https://docs.github.com/en/actions) and [Docker documentation](https://docs.docker.com/). \ No newline at end of file