Skip to content

Commit

Permalink
feat: ajouter un workflow de publication et des tâches Gulp pour la g…
Browse files Browse the repository at this point in the history
…estion des builds
  • Loading branch information
Mara-Li committed Dec 24, 2024
1 parent 90f24ce commit d25628b
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 5 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Build and push
on:
push:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup bun
uses: oven-sh/setup-bun@v2
- name: install dep
run: bun install
- name: build
run: bun run publish
- name: commit and push new version
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add ./dist
git commit -m "Publish builded files"
git push origin HEAD:master
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ out
# Nuxt.js build / generate output

.nuxt
dist

# Gatsby files

Expand Down
24 changes: 21 additions & 3 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@ import cleanCSS from "gulp-clean-css";

gulp.task('scripts', function() {
return gulp.src("js/*.js")
.pipe(concat('scripts.js'))
.pipe(concat('index.js'))
.pipe(uglify())
.pipe(gulp.dest('../docs/_static/js'));
}
);
});


gulp.task("styles", function() {
Expand All @@ -19,5 +18,24 @@ gulp.task("styles", function() {
.pipe(gulp.dest("../docs/_static/css"));
});

gulp.task('watch', function() {
gulp.watch('js/*.js', gulp.series('scripts'));
gulp.watch('css/*.css', gulp.series('styles'));
});

gulp.task('publish', function(done) {
gulp.src("js/*.js")
.pipe(concat('index.js'))
.pipe(uglify())
.pipe(gulp.dest('./dist')); // New destination

gulp.src("css/*.css")
.pipe(concat("styles.css"))
.pipe(cleanCSS())
.pipe(gulp.dest('./dist')); // New destination

done();
});

gulp.task('default', gulp.parallel('scripts', 'styles'));

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
},
"scripts": {
"build": "gulp",
"watch": "gulp watch"
"watch": "gulp watch",
"publish": "gulp publish"
},
"dependencies": {
"gulp": "^5.0.0",
Expand Down

0 comments on commit d25628b

Please sign in to comment.