diff --git a/.github/workflows/npm-gulp.yml b/.github/workflows/npm-gulp.yml index c28862c..b5e4b57 100644 --- a/.github/workflows/npm-gulp.yml +++ b/.github/workflows/npm-gulp.yml @@ -31,7 +31,7 @@ jobs: - name: Upload GitHub Pages artifact uses: actions/upload-pages-artifact@v2.0.0 #https://github.com/actions/upload-pages-artifact with: - path: ./dist + path: ./dist-pages deploy: needs: build diff --git a/.gitignore b/.gitignore index 78c15b9..61511c1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ package-lock.json node_modules/ dist/ +dist-pages/ \ No newline at end of file diff --git a/gulpfile.js b/gulpfile.js index f4bb3ef..2d26e79 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -8,8 +8,7 @@ const buffer = require('vinyl-buffer'); const watchify = require('watchify'); const fancy_log = require('fancy-log'); const tar = require('gulp-tar'); -const gzip = require('gulp-gzip'); -const rename = require('gulp-rename'); +const zip = require('gulp-zip'); const {rimraf} = require('rimraf'); const yargs = require('yargs'); @@ -17,10 +16,8 @@ const argv = yargs.argv; const noSourceMaps = argv.noSourceMaps !== undefined; const destPath = './dist'; -const destPathContent = destPath + '/**'; -const githubPagesTarFile = 'github-pages.tar'; -const githubPagesGzipFile = 'github-pages'; +const githubPagesPath = './dist-pages'; const watchedBrowserify = watchify( browserify({ @@ -83,24 +80,22 @@ gulp.task('stop-watchify', function (done) { done(); }); -gulp.task('github-pages-tar', () => { - return gulp.src(destPathContent) - .pipe(tar(githubPagesTarFile)) - .pipe(gulp.dest(destPath)) -}); +gulp.task('github-pages-clean', () => { + return rimraf(githubPagesPath); +}) gulp.task('github-pages-gzip', () => { - return gulp.src(destPath + '/' + githubPagesTarFile) - .pipe(gzip()) - .pipe(rename('github-pages')) - .pipe(gulp.dest(destPath)) -}); + return gulp.src(destPath + '/**') + .pipe(tar('content.tar')) + .pipe(zip('github-pages')) + .pipe(gulp.dest(githubPagesPath)); +}) gulp.task('build', gulp.series( gulp.parallel('clean'), gulp.parallel('html', 'scripts', 'assets'), - gulp.parallel('github-pages-tar'), + gulp.parallel('github-pages-clean'), gulp.parallel('github-pages-gzip'), gulp.parallel('stop-watchify') ) diff --git a/package.json b/package.json index b06a620..b9cf009 100644 --- a/package.json +++ b/package.json @@ -14,6 +14,7 @@ "gulp-tar": "^3.1.0", "gulp-terser": "^2.1.0", "gulp-typescript": "^6.0.0-alpha.1", + "gulp-zip": "^5.1.0", "rimraf": "^5.0.1", "tsify": "^5.0.4", "typescript": "^4.9.5",