From 9bd5bd7f7867fb499631767c1b9ba57a6a587517 Mon Sep 17 00:00:00 2001 From: phapsidesGT Date: Thu, 5 Sep 2024 12:45:43 +0100 Subject: [PATCH] New start --- .github/workflows/ci-cd.yml | 47 ++++++++++++++++++++++--------------- 1 file changed, 28 insertions(+), 19 deletions(-) diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index 90d6c22bfcf..5c45e29be4b 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -1,29 +1,38 @@ -name: CI/CD Pipeline for Shopify +# .github/workflows/deploy-shopify-theme.yml + +name: Deploy Shopify Theme on: push: branches: + - main - feature/github-actions # Change 'feature/github-actions' to main jobs: deploy: - name: Deploy to Shopify Store runs-on: ubuntu-latest + steps: - - uses: actions/checkout@v3 - - - name: Set up Node.js - uses: actions/setup-node@v2 - with: - node-version: '18' - - - name: Install Shopify CLI - run: npm install -g @shopify/cli @shopify/theme - - - name: Deploy Theme to Shopify - env: - SHOPIFY_STORE_URL: ${{ secrets.SHOPIFY_STORE_URL }} - SHOPIFY_THEME_ID: ${{ secrets.SHOPIFY_THEME_ID }} - SHOPIFY_CLI_AUTH_TOKEN: ${{ secrets.SHOPIFY_CLI_AUTH_TOKEN }} - SHOPIFY_FLAG_FORCE: 1 - run: shopify theme push --verbose --allow-live --store=${{ secrets.SHOPIFY_STORE_URL }} --theme=${{ secrets.SHOPIFY_THEME_ID }} \ No newline at end of file + - 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 + gem install bundler + + - name: Install Shopify CLI + run: | + gem install shopify-cli + + - name: Deploy to Shopify + env: + SHOPIFY_API_TOKEN: ${{ secrets.SHOPIFY_API_TOKEN }} + SHOPIFY_STORE: ${{ secrets.SHOPIFY_STORE }} + run: | + # Authenticate Shopify CLI + shopify login --store=$SHOPIFY_STORE --password=$SHOPIFY_API_TOKEN + + # Push theme to Shopify store + shopify theme push --allow-live \ No newline at end of file