Merge pull request 'develop' (#114) from develop into main
All checks were successful
Build and Deploy Website / Build Website (push) Successful in 18s
Build and Deploy Website / Deploy Dev Website (push) Has been skipped
Build and Deploy Website / Deploy Website (push) Successful in 4s

Reviewed-on: #114
This commit is contained in:
Samuel Philipp 2024-04-09 23:30:18 +00:00
commit 2b749960ff
3 changed files with 10 additions and 84 deletions

View file

@ -9,7 +9,7 @@ jobs:
container:
image: node:lts
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install Dependencies
run: npm install
- name: Build Website
@ -30,7 +30,7 @@ jobs:
- name: Install Dependencies
run: which lftp || ( apk --update add lftp )
- name: Deploy Website
run: lftp -e "set ftp:ssl-force true; set ssl:verify-certificate no; mirror -R ./build/ dev.sp-magic.de/; bye" -u $FTP_USERNAME,$FTP_PASSWORD $FTP_HOST
run: lftp -e "set ftp:ssl-force true; set ssl:verify-certificate no; mirror -R -e ./build/ dev.sp-magic.de/; bye" -u $FTP_USERNAME,$FTP_PASSWORD $FTP_HOST
env:
FTP_HOST: ${{ secrets.FTP_HOST }}
FTP_USERNAME: ${{ secrets.FTP_USERNAME }}
@ -47,7 +47,7 @@ jobs:
- name: Install Dependencies
run: which lftp || ( apk --update add lftp )
- name: Deploy Website
run: lftp -e "set ftp:ssl-force true; set ssl:verify-certificate no; mirror -R ./build/ sp-magic.de/; bye" -u $FTP_USERNAME,$FTP_PASSWORD $FTP_HOST
run: lftp -e "set ftp:ssl-force true; set ssl:verify-certificate no; mirror -R -e ./build/ sp-magic.de/; bye" -u $FTP_USERNAME,$FTP_PASSWORD $FTP_HOST
env:
FTP_HOST: ${{ secrets.FTP_HOST }}
FTP_USERNAME: ${{ secrets.FTP_USERNAME }}

View file

@ -4,7 +4,6 @@
*/
var settings = {
clean: true,
scripts: true,
styles: true,
copy: true,
reload: true
@ -17,10 +16,6 @@ var settings = {
var paths = {
input: 'src/',
output: 'dist/',
scripts: {
input: 'src/js/*.js',
output: 'dist/js/'
},
styles: {
input: 'src/scss/*.scss',
output: 'dist/css/'
@ -59,17 +54,10 @@ var banner = {
// General
var {src, dest, watch, series, parallel} = require('gulp');
var del = require('del');
var flatmap = require('gulp-flatmap');
var lazypipe = require('lazypipe');
var rename = require('gulp-rename');
var header = require('gulp-header');
var package = require('./package.json');
// Scripts
var concat = require('gulp-concat');
var uglify = require('gulp-terser');
var optimizejs = require('gulp-optimize-js');
// Styles
var sass = require('gulp-sass')(require('sass'));
var postcss = require('gulp-postcss');
@ -100,62 +88,6 @@ var cleanDist = function (done) {
};
// Repeated JavaScript tasks
var jsTasks = lazypipe()
.pipe(header, banner.main, {package: package})
.pipe(optimizejs)
.pipe(dest, paths.scripts.output)
.pipe(rename, {suffix: '.min'})
.pipe(uglify)
.pipe(optimizejs)
.pipe(header, banner.main, {package: package})
.pipe(dest, paths.scripts.output);
// minify, and concatenate scripts
var buildScripts = function (done) {
// Make sure this feature is activated before running
if (!settings.scripts) return done();
// Run tasks on script files
return src(paths.scripts.input)
.pipe(flatmap(function(stream, file) {
// If the file is a directory
if (file.isDirectory()) {
// Setup a suffix variable
var suffix = '';
// If separate polyfill files enabled
if (settings.polyfills) {
// Update the suffix
suffix = '.polyfills';
// Grab files that aren't polyfills, concatenate them, and process them
src([file.path + '/*.js', '!' + file.path + '/*' + paths.scripts.polyfills])
.pipe(concat(file.relative + '.js'))
.pipe(jsTasks());
}
// Grab all files and concatenate them
// If separate polyfills enabled, this will have .polyfills in the filename
src(file.path + '/*.js')
.pipe(concat(file.relative + suffix + '.js'))
.pipe(jsTasks());
return stream;
}
// Otherwise, process the file
return stream.pipe(jsTasks());
}));
};
// Process, and minify Sass files
var buildStyles = function (done) {
// Make sure this feature is activated before running
@ -239,7 +171,6 @@ var watchSource = function (done) {
exports.default = series(
cleanDist,
parallel(
buildScripts,
buildStyles,
copyFiles
)

View file

@ -12,25 +12,20 @@
"url": "https://git.sp-codes.de/samuel-p/sp-magic.de"
},
"optionalDependencies": {
"browser-sync": "^2.29.3"
"browser-sync": "^3.0.2"
},
"devDependencies": {
"autoprefixer": "10.4.16",
"cssnano": "6.0.1",
"autoprefixer": "10.4.19",
"cssnano": "6.1.2",
"del": "6.1.1",
"gulp": "4.0.2",
"gulp-concat": "2.6.1",
"gulp-flatmap": "1.0.2",
"gulp": "5.0.0",
"gulp-header": "2.0.9",
"gulp-optimize-js": "1.1.0",
"gulp-postcss": "9.0.1",
"gulp-postcss": "10.0.0",
"gulp-rename": "2.0.0",
"gulp-sass": "5.1.0",
"gulp-terser": "2.1.0",
"lazypipe": "1.0.2",
"node-sass-tilde-importer": "^1.0.2",
"postcss": "^8.4.32",
"sass": "^1.69.5"
"postcss": "^8.4.38",
"sass": "^1.74.1"
},
"dependencies": {
"@fortawesome/fontawesome-free": "^5.15.4",