Blog Engineering How to deploy Shopify themes with GitLab
2022-04-14
2 min read

How to deploy Shopify themes with GitLab

Streamline your development workflow by configuring auto deployments for Shopify themes with GitLab pipelines.

storefront.jpg

1.75 million sellers are using Shopify's eCommerce platform, and every one of these online stores has a codebase that lives somewhere. You may have encountered some challenges while scaling your development efforts at your organization while working within Shopify. Setting up a process for repeatable deployments with GitLab can keep everything streamlined and safe. No one wants something going live in production before it's ready.

Here's a simple development flow you are going to be able to replicate using GitLab CI/CD pipelines for Shopify theme deployments.

  1. Develop locally on a feature branch until you are happy with your local changes
  2. Merge your feature branch into your main branch → This will update the staging theme in Shopify
  3. When everything is ready to go live, create a new tag and push it to GitLab → The live theme will be updated automatically 🎉

This tutorial assumes you have set up a repository in a GitLab project.

1. Add your variables

For security purposes, you don't want to store your credentials for your Shopify site in your configuration file. You can use variables in GitLab to handle that.

Use the ThemeKit CLI to retrieve all the available theme IDs from your Shopify store by entering this into your command line:

theme get --list -p=[shopify-api-access-token] -s=[your-store.myshopify.com]

Help: Generate API credentials in Shopify

Open your project in GitLab, navigate to /settings/ci_cd, and open the variables section.

Add four unique variables with their corresponding keys and values

Key Value

We want to hear from you

Enjoyed reading this blog post or have questions or feedback? Share your thoughts by creating a new topic in the GitLab community forum. Share your feedback

Ready to get started?

See what your team could do with a unified DevSecOps Platform.

Get free trial

New to GitLab and not sure where to start?

Get started guide

Learn about what GitLab can do for your team

Talk to an expert