Home

Awesome

Shopify Workflow PoC

This is a Proof of Concept of workflow with different environments using Github and GitHub Actions.

Workflow

GitHub Actions

Pre-requisites :

Shopify stores

We're using 2 stores for our workflow with multiple themes :

Branches

Philosophy

Production and staging store have same configuration. But we often have the same content between the two environments.

Workflow

Workflow is pretty simple, based on GitFlow but with no release branch nor tags.

master, preprod and develop branches are protected. It's not possible to push directly on them. The best way is to use pull requests.

Principal

  1. Create a new branch from master (eg. feature/store-locator)
    • Best practice : prefix branch with fix/ for a fix or feature/ for a new feature
  2. Apply commit(s) to this branch
  3. Merge feature/store-locator into develop
    • It will deploy on staging theme, then test your changes
  4. If changes are not good, return to step 2. Otherwise, merge feature/store-locator into preprod
    • It will deploy on pre-production theme, then test your changes
  5. If changes are not good, return to step 2. Otherwise, merge feature/store-locator into master
    • It will deploy on production theme, your changes are now live!

Basic workflow

Workflow with multiple branches

Workflow with fix

New branch always start from master one, even if the purpose is a new feature or a fix.

Local development

We're using Theme Kit for local developers : https://shopify.github.io/themekit/ We created a template on development store for each developer.

CI/CD with GitHub Actions

Actions

Workflow files are available here. They used the Deploy Shopify theme Actions : https://github.com/marketplace/actions/deploy-shopify-theme

Secrets

First you have to generate a private app to get an API KEY on Shopify. Get API Access.

Then you'll need to provide some secrets :

env vars

License

The Dockerfile and associated scripts and documentation in this project are released under the MIT License.