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.
- Develop locally on a feature branch until you are happy with your local changes
- Merge your
feature
branch into yourmain
branch → This will update the staging theme in Shopify - 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]
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 |
---|