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