From ba194c675332252663ab126edf86ee1fff50d39d Mon Sep 17 00:00:00 2001 From: phapsidesGT Date: Tue, 3 Sep 2024 16:37:46 +0100 Subject: [PATCH] Test commit 12 --- .github/workflows/ci-cd.yml | 6 ++--- assets/base.css | 4 ---- push-theme.sh | 48 +++++++++++++++---------------------- 3 files changed, 22 insertions(+), 36 deletions(-) diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index 50426cc5df7..6999411cc6a 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -4,7 +4,7 @@ on: push: branches: - main - - feature/github-actions # Replace with your branch name + - feature/github-actions # Replace with your branch name as needed jobs: deploy: @@ -18,7 +18,7 @@ jobs: run: | curl -s https://shopify.dev/tools/cli/install | sh shopify version - + - name: Deploy to Shopify env: SHOPIFY_PASSWORD: ${{ secrets.SHOPIFY_PASSWORD }} @@ -29,7 +29,7 @@ jobs: shopify config set store $SHOPIFY_STORE shopify config set password $SHOPIFY_PASSWORD - # Push theme to Shopify store with retry logic + # Retry logic to push theme to Shopify store attempt=0 max_attempts=5 delay=1 diff --git a/assets/base.css b/assets/base.css index c459b44e425..51bbc7a33b4 100644 --- a/assets/base.css +++ b/assets/base.css @@ -3605,8 +3605,4 @@ details-disclosure>details { 100% { transform: translateX(100%) scaleX(0); } -} - -body { - background: red !important; } \ No newline at end of file diff --git a/push-theme.sh b/push-theme.sh index a39d6711d63..6f358d86d7d 100755 --- a/push-theme.sh +++ b/push-theme.sh @@ -1,5 +1,3 @@ -#!/bin/bash - # Load environment variables from .env file set -a source .env @@ -11,33 +9,25 @@ if [[ -z "$SHOPIFY_PASSWORD" || -z "$SHOPIFY_STORE" || -z "$THEME_ID" ]]; then exit 1 fi -# Function to push theme with retry logic -push_theme() { - local attempt=0 - local max_attempts=5 - local delay=1 +# Retry logic to push theme to Shopify store +attempt=0 +max_attempts=5 +delay=1 - while ((attempt < max_attempts)); do - echo "Pushing theme (Attempt: $((attempt + 1))/$max_attempts)..." - - # Push theme to Shopify store - shopify theme push --store "$SHOPIFY_STORE" --password "$SHOPIFY_PASSWORD" --theme "$THEME_ID" --allow-live - - # Check if push was successful - if [ $? -eq 0 ]; then - echo "Theme pushed successfully." - return 0 - else - echo "Error encountered. Retrying in $delay seconds..." - sleep $delay - attempt=$((attempt + 1)) - delay=$((delay * 2)) # Exponential backoff - fi - done +while [ $attempt -lt $max_attempts ]; do + echo "Pushing theme (Attempt: $((attempt + 1))/$max_attempts)..." + if shopify theme push --store "$SHOPIFY_STORE" --password "$SHOPIFY_PASSWORD" --theme-id "$THEME_ID" --allow-live; then + echo "Theme pushed successfully." + break + else + echo "Error encountered. Retrying in $delay seconds..." + sleep $delay + attempt=$((attempt + 1)) + delay=$((delay * 2)) # Exponential backoff + fi +done +if [ $attempt -eq $max_attempts ]; then echo "Failed to push theme after $max_attempts attempts." - return 1 -} - -# Run the function -push_theme \ No newline at end of file + exit 1 +fi \ No newline at end of file