From 1073024915656dd2f3ad06a73d09e764cb619663 Mon Sep 17 00:00:00 2001 From: TheMux <165564183+TheMux-42@users.noreply.github.com> Date: Tue, 23 Jun 2026 23:57:04 +0200 Subject: [PATCH 1/3] Revise README for GitHub Actions Docker Template Updated README to provide detailed project information, features, branch strategy, and usage instructions. --- README.md | 39 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 37 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5771cbe..5066009 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,37 @@ -# project_template_ghcr -This is a simple project template for utilizing ghcr on first pull. +# 🚀 GitHub Actions Docker Template + +A lightweight DevOps starter template for containerized services using GitHub Actions, Docker, and GitHub Container Registry (GHCR). + +This template is designed to eliminate manual server builds and provide a fully automated CI/CD pipeline for modern service deployment. + +--- + +## 🧱 Features + +- ⚡ Automated CI/CD via GitHub Actions +- 🐳 Docker-based deployment +- 📦 Container publishing to GitHub Container Registry (GHCR) +- 🌿 Branch-based environments (`dev`, `latest-stable`) +- 🔁 Automatic image tagging based on branch name +- 🖥️ Server-only runtime (no build required on host) +- ♻️ Fully reusable template for multiple services + +--- + +## 🌿 Branch Strategy + +| Branch | Purpose | Image Tag | +|--------------|--------------------|----------| +| `dev` | Development | `dev` | +| `latest-stable` | Stable production | `latest-stable` | + +--- + +## 🚀 How to Use This Template + +1. Click **"Use this template"** on GitHub +2. Create a new repository +3. Clone your new repo: + +```bash +git clone https://github.com/TheMux-42/github-actions-docker-template.git From 133c4ce01aff53b4bd25b1d694ff7bce1d279ada Mon Sep 17 00:00:00 2001 From: TheMux <165564183+TheMux-42@users.noreply.github.com> Date: Tue, 23 Jun 2026 23:58:34 +0200 Subject: [PATCH 2/3] Enhance Docker build workflow with tag support Updated the Docker build workflow to include tag handling and improved variable naming. --- .github/workflows/docker-build.yml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index e1b71c9..f520216 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -3,6 +3,7 @@ name: Build & Push Docker Image on: push: branches: [ "main", "dev" ] + tags: [ "v*" ] jobs: build: @@ -16,10 +17,18 @@ jobs: - name: Checkout uses: actions/checkout@v4 - - name: Set variables (safe + lowercase) + - name: Set variables (safe + lowercase + tag/branch aware) run: | REPO="${GITHUB_REPOSITORY,,}" - TAG="${GITHUB_REF_NAME}" + + # detect tag vs branch + if [[ "${GITHUB_REF_TYPE}" == "tag" ]]; then + TAG="${GITHUB_REF_NAME}" + else + TAG="${GITHUB_REF_NAME}" + fi + + # lowercase safety TAG=$(echo "$TAG" | tr '[:upper:]' '[:lower:]') echo "REPO=$REPO" >> $GITHUB_ENV @@ -29,6 +38,7 @@ jobs: run: | echo "Repo: $REPO" echo "Tag: $TAG" + echo "Ref type: $GITHUB_REF_TYPE" - name: Login to GHCR run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin From d1e15b93aee58b71a179a82a34792419f7b1968d Mon Sep 17 00:00:00 2001 From: TheMux <165564183+TheMux-42@users.noreply.github.com> Date: Wed, 24 Jun 2026 00:02:30 +0200 Subject: [PATCH 3/3] Update branch strategy and usage instructions in README --- README.md | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 5066009..b95d2d3 100644 --- a/README.md +++ b/README.md @@ -20,10 +20,11 @@ This template is designed to eliminate manual server builds and provide a fully ## 🌿 Branch Strategy -| Branch | Purpose | Image Tag | -|--------------|--------------------|----------| -| `dev` | Development | `dev` | -| `latest-stable` | Stable production | `latest-stable` | +| Branch | Purpose | Image Tag | +|----------------|--------------------|------------------| +| `dev` | Development | `dev` | +| `main` | Stable production | `main` | +| `v*` (tags) | Releases | `v1.0.0`, etc. | --- @@ -33,5 +34,6 @@ This template is designed to eliminate manual server builds and provide a fully 2. Create a new repository 3. Clone your new repo: -```bash +```bash id="clone1" git clone https://github.com/TheMux-42/github-actions-docker-template.git +cd github-actions-docker-template