The key to development automation is Git. In case you’re beginning your coding journey

Git is a version control system that keeps your code safe and sound repositories:

  • it allows you to develop new features locally on your computer, so you can test them and clear bugs before merging to the main code line
  • every member of your team can work independently without the risk of overwriting changes
  • you can quickly revert changes if needed

Begin with downloading your Shopify theme so we can put it in a repository:

Let’s assume we want to minify some assets with Gulp. First, you need to create the /js directory in the /assets folder and move all JS files there. Then, add a gulpfile.js with the minifying script:

'use strict';

var gulp = require('gulp'),
    concat = require('gulp-concat'),
    uglify = require('gulp-uglifyjs');

gulp.task('js', function () {
    gulp.src('assets/js/*.js')
   .pipe(concat('shop.js'))
   .pipe(uglify())
   .pipe(gulp.dest('assets/'))

});

gulp.task('watch', function () {
   gulp.watch(['/assets/*.js'], ['js']);
});

gulp.task('default', function() {
   gulp.start('js');
});

And a package.json with the npm details, too:

{
 "name": "shopify-js-gulp",
 "version": "1.0.0",
 "description": "Buddy Shopify",
 "license": "ISC",

 "devDependencies": {
   "gulp": "^3.9.1",
   "gulp-uglifyjs": "^0.6.2",
   "gulp-concat": "^2.6.0"
 }
}

Now it’s time for the fun part. Instead of running the script manually, we’ll create a delivery pipeline that will build and deploy our theme to Shopify on a single push to the repository:

The tool used in the video is Buddy, a user-friendly delivery automation app for web developers. It requires no special

We can do that with Buddy, a user-friendly tool

  1. Sign up to Buddy with your GitHub account
  2. Select the repository with your Shopify theme
  3. Add a new delivery pipeline. Enter the pipeline name, set the trigger mode to ‘On every push’ and assign it to the branch from which you want to deploy.
  1. Add the Gulp action that will run your script:

  2. Add the Shopify action. Enter your credentials and select the shop to which you want to deploy. Make sure to add the following files to the ignore list:

    gulpfile.js
    package.json
    node_modules/
    assets/js/
    

When done, make a push to the repository and watch the magic happen: Buddy will automatically pick the latest changes, run Gulp, and deploy the theme to Shopify. This means you can update your shop without even leaving the terminal!