Skip to content

Fix PATH and directly export in each session #37

Fix PATH and directly export in each session

Fix PATH and directly export in each session #37

Workflow file for this run

# .github/workflows/deploy-shopify-theme.yml
name: Deploy Shopify Theme
on:
push:
branches:
- main
- feature/* # Adjust branches as needed
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Ruby environment
run: |
sudo apt-get update
sudo apt-get install -y ruby-full build-essential
- name: Install Shopify CLI Locally
run: |
echo "Installing Shopify CLI..."
gem install --user-install shopify-cli
# Add Ruby Gems to PATH
echo "export PATH=$(ruby -e 'print Gem.user_dir')/bin:\$PATH" >> $GITHUB_ENV
- name: Verify and Debug PATH
run: |
# Directly export the PATH for this session
export PATH=$(ruby -e 'print Gem.user_dir')/bin:$PATH
echo "Updated PATH: $PATH"
ls $(ruby -e 'print Gem.user_dir')/bin # List contents to verify Shopify CLI installation
which shopify # Check if Shopify is in the PATH
shopify version
- name: Deploy to Shopify
env:
SHOPIFY_CLI_AUTH_TOKEN: ${{ secrets.SHOPIFY_API_TOKEN }}
SHOPIFY_STORE: ${{ secrets.SHOPIFY_STORE }}
run: |
# Directly export the PATH for this session
export PATH=$(ruby -e 'print Gem.user_dir')/bin:$PATH
# Authenticate using the API token
export SHOPIFY_CLI_AUTH_TOKEN=$SHOPIFY_CLI_AUTH_TOKEN
# Push theme to Shopify store
shopify theme push --store "$SHOPIFY_STORE" --allow-live