From f92c22343eea9376f020a1856d454db26c9a6172 Mon Sep 17 00:00:00 2001
From: Steven Ngesera <muhngesteven@gmail.com>
Date: Sun, 10 Nov 2024 10:29:06 +0300
Subject: [PATCH] Debug DOCKER_USERNAME

---
 .github/workflows/Nightly-Image.yml | 24 +++++++++++++++++++++---
 1 file changed, 21 insertions(+), 3 deletions(-)

diff --git a/.github/workflows/Nightly-Image.yml b/.github/workflows/Nightly-Image.yml
index cb1b64171..d9802e5d0 100644
--- a/.github/workflows/Nightly-Image.yml
+++ b/.github/workflows/Nightly-Image.yml
@@ -21,6 +21,9 @@ on:
 jobs:
   build-and-push:
     runs-on: ubuntu-latest
+    env:
+      DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
+      DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
 
     strategy:
       matrix:
@@ -38,12 +41,27 @@ jobs:
       - name: Set up Docker Buildx
         uses: docker/setup-buildx-action@v2
 
+      # Debug to check if secrets are accessed
+      # Step to check if environment variables are set
+      - name: Check if DOCKER_USERNAME and DOCKER_PASSWORD are set
+        run: |
+          if [ -n "$DOCKER_USERNAME" ]; then
+            echo "DOCKER_USERNAME is set"
+          else
+            echo "DOCKER_USERNAME is NOT set"
+          fi
+
+          if [ -n "$DOCKER_PASSWORD" ]; then
+            echo "DOCKER_PASSWORD is set"
+          else
+            echo "DOCKER_PASSWORD is NOT set"
+          fi
       # Log in to Docker Hub
       - name: Log in to Docker Hub
         uses: docker/login-action@v2
         with:
-          username: ${{ secrets.DOCKER_USERNAME }}
-          password: ${{ secrets.DOCKER_PASSWORD }}
+          username: ${{ env.DOCKER_USERNAME }}
+          password: ${{ env.DOCKER_PASSWORD }}
 
       # Build and push the Docker image for linux/amd64 and linux/arm64
       - name: Build and push Docker image
@@ -53,7 +71,7 @@ jobs:
           platforms: linux/amd64,linux/arm64
           file: ./docker/Dockerfile
           push: true
-          tags: ${{ secrets.DOCKER_USERNAME }}/cypht-nightly:${{ matrix.php_version }}
+          tags: ${{ env.DOCKER_USERNAME }}/cypht-nightly:${{ matrix.php_version }}
 
       # Log out from Docker Hub
       - name: Log out from Docker Hub