Skip to content

Commit

Permalink
adding autodeploy with minification fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mmarienko committed Nov 10, 2023
1 parent ca1e718 commit e5925b8
Show file tree
Hide file tree
Showing 6 changed files with 7,391 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/deploy-theme.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Theme deploy
on:
push:
branches:
- main
jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v3
with:
node-version: 18
- uses: ruby/setup-ruby@v1
with:
ruby-version: 3.1
bundler: 'latest'
- name: Install Shopify CLI
run: npm install -g @shopify/cli @shopify/theme
- name: Install dependencies
run: npm install
- name: Run gulp scripts
run: npm run styles & npm run scripts
- name: Deploy
env:
SHOPIFY_FLAG_STORE: ${{ secrets.SHOPIFY_STORE }}
SHOPIFY_CLI_THEME_TOKEN: ${{ secrets.SHOPIFY_CLI_THEME_TOKEN }}
SHOPIFY_CLI_TTY: 0
run: shopify theme push --theme ${{ secrets.SHOPIFY_THEME_ID }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@
.Trashes
ehthumbs.db
Thumbs.db
node_modules
11 changes: 11 additions & 0 deletions .shopifyignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db
node_modules
package.json
package-lock.json
gulpfile.js
26 changes: 26 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
const gulp = require('gulp');
const postcss = require('gulp-postcss');
const autoprefixer = require('autoprefixer');
const cssnano = require('cssnano');
const babel = require('gulp-babel');
const uglify = require('gulp-uglify');

gulp.task('styles', function () {
return gulp
.src('./assets/*.css')
.pipe(postcss([
autoprefixer(),
cssnano(),
]))
.pipe(gulp.dest('./assets'));
});

gulp.task('scripts', function () {
return gulp
.src('./assets/*.js')
.pipe(babel({
presets: ['@babel/env']
}))
.pipe(uglify())
.pipe(gulp.dest('./assets'));
});
Loading

0 comments on commit e5925b8

Please sign in to comment.