Skip to content

Commit

Permalink
Test commit 12
Browse files Browse the repository at this point in the history
  • Loading branch information
phapsidesGT committed Sep 3, 2024
1 parent 64efb35 commit ba194c6
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 36 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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 }}
Expand All @@ -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
Expand Down
4 changes: 0 additions & 4 deletions assets/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -3605,8 +3605,4 @@ details-disclosure>details {
100% {
transform: translateX(100%) scaleX(0);
}
}

body {
background: red !important;
}
48 changes: 19 additions & 29 deletions push-theme.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/bin/bash

# Load environment variables from .env file
set -a
source .env
Expand All @@ -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
exit 1
fi

0 comments on commit ba194c6

Please sign in to comment.