Simpler and faster builds
This commit is contained in:
parent
465f2266fc
commit
592fa6d673
22
.build.yml
22
.build.yml
|
@ -1,27 +1,9 @@
|
|||
image: nixos/latest
|
||||
packages:
|
||||
- nixos.html-minifier
|
||||
- nixos.lightningcss
|
||||
- nixos.neocities-cli
|
||||
- nixos.nodejs
|
||||
- nixos.nodePackages.pnpm
|
||||
- nixos.sass
|
||||
environment:
|
||||
repo: vegan-prestwich
|
||||
sources:
|
||||
- https://git.sr.ht/~stfn/vegan-prestwich
|
||||
secrets:
|
||||
- ff7f6e84-35b9-4aa9-afa1-1fbc3fe6a2d1 # ~/.neocities/$repo
|
||||
- ff7f6e84-35b9-4aa9-afa1-1fbc3fe6a2d1 # ~/.neocities/vegan-prestwich
|
||||
tasks:
|
||||
- build: |
|
||||
cd vegan-prestwich
|
||||
pnpm add fast-glob @11ty/eleventy
|
||||
mkdir -p _site/style
|
||||
sass style/style.scss _site/style/style.css
|
||||
lightningcss --minify --targets '> 0.25%, not IE 11' _site/style/*.css -o _site/style/*.css
|
||||
pnpm eleventy
|
||||
html-minifier --input-dir _site --output-dir _site --collapse-whitespace --file-ext html
|
||||
set +x
|
||||
export NEOCITIES_API_KEY=$(cat /home/build/.neocities/vegan-prestwich)
|
||||
set -x
|
||||
neocities push --prune _site
|
||||
sh bin/build
|
||||
|
|
18
.gitignore
vendored
18
.gitignore
vendored
|
@ -1,21 +1,5 @@
|
|||
_site
|
||||
.bundle
|
||||
.DS_Store
|
||||
.eleventy.js.swp
|
||||
.jekyll-cache
|
||||
.jekyll-metadata
|
||||
.neocities
|
||||
.nix-gems
|
||||
.nova
|
||||
.sass-cache
|
||||
.jampack
|
||||
nix-profile*
|
||||
Cache
|
||||
Gemfile.lock
|
||||
_site
|
||||
node_modules
|
||||
package-lock.json
|
||||
package.json
|
||||
vendor
|
||||
venv
|
||||
.direnv/bin/nix-direnv-reload
|
||||
.idea
|
|
@ -1 +0,0 @@
|
|||
3.1.2
|
34
bin/build
Executable file
34
bin/build
Executable file
|
@ -0,0 +1,34 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
rm -rf _site
|
||||
mkdir -p _site/style
|
||||
|
||||
nix-shell -p sass --pure --command "
|
||||
echo 'Compiling SCSS'
|
||||
sass style/style.scss _site/style/style.css
|
||||
"
|
||||
|
||||
nix-shell -p lightningcss --pure --command "
|
||||
echo 'Minifying CSS'
|
||||
lightningcss --minify --targets '> 0.25%, not IE 11' _site/style/*.css -o _site/style/*.css
|
||||
"
|
||||
|
||||
nix-shell -p nodePackages.pnpm --command "
|
||||
echo 'Building site'
|
||||
pnpm add fast-glob @11ty/eleventy @11ty/eleventy-img
|
||||
pnpm eleventy
|
||||
"
|
||||
|
||||
nix-shell -p html-minifier --pure --command "
|
||||
echo 'Minifying HTML'
|
||||
html-minifier --input-dir _site --output-dir _site --collapse-whitespace --file-ext html
|
||||
"
|
||||
|
||||
nix-shell -p neocities-cli --command "
|
||||
echo 'Pushing to Neocities'
|
||||
|
||||
set +x
|
||||
export NEOCITIES_API_KEY=$(cat ~/.neocities/vegan-prestwich)
|
||||
set -x
|
||||
neocities push --prune _site
|
||||
"
|
15
bin/serve
Executable file
15
bin/serve
Executable file
|
@ -0,0 +1,15 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
rm -rf _site
|
||||
mkdir -p _site/style
|
||||
|
||||
nix-shell -p sass --pure --command "
|
||||
echo 'Compiling SCSS'
|
||||
sass style/style.scss _site/style/style.css
|
||||
"
|
||||
|
||||
nix-shell -p nodePackages.pnpm --command "
|
||||
echo 'Serving site'
|
||||
pnpm add fast-glob @11ty/eleventy @11ty/eleventy-img
|
||||
pnpm eleventy --serve
|
||||
"
|
6
bin/upgrade
Executable file
6
bin/upgrade
Executable file
|
@ -0,0 +1,6 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
nix-shell -p nodePackages.pnpm --command "
|
||||
echo 'Upgrading packages'
|
||||
pnpm upgrade
|
||||
"
|
|
@ -1,13 +0,0 @@
|
|||
#!/usr/bin/env
|
||||
|
||||
rm -rf _site
|
||||
pnpm add fast-glob @11ty/eleventy
|
||||
mkdir -p _site/style
|
||||
sass style/style.scss _site/style/style.css
|
||||
lightningcss --minify --targets '> 0.25%, not IE 11' _site/style/*.css -o _site/style/*.css
|
||||
pnpm eleventy
|
||||
html-minifier --input-dir _site --output-dir _site --collapse-whitespace --file-ext html
|
||||
set +x
|
||||
export NEOCITIES_API_KEY=$(cat /home/user/.neocities/vegan-prestwich)
|
||||
set -x
|
||||
neocities push --prune _site
|
|
@ -1,7 +0,0 @@
|
|||
#!/bin/bash
|
||||
gem install --no-document neocities
|
||||
set +x
|
||||
export NEOCITIES_API_KEY=$(cat ~/.neocities/$1)
|
||||
set -x
|
||||
neocities push --prune $2
|
||||
|
25
package.json
25
package.json
|
@ -1,22 +1,7 @@
|
|||
{
|
||||
"devDependencies": {
|
||||
"@11ty/eleventy": "^3.0.0",
|
||||
"npm-run-all": "^4.1.5"
|
||||
},
|
||||
"dependencies": {
|
||||
"@11ty/eleventy-img": "^5.0.0",
|
||||
"cross-env": "^7.0.3",
|
||||
"fast-glob": "^3.3.2"
|
||||
},
|
||||
"scripts": {
|
||||
"watch:sass": "sass --no-source-map --watch style:_site/style",
|
||||
"watch:eleventy": "eleventy --serve",
|
||||
"build:rm": "rm -rf _site",
|
||||
"build:sass": "sass --no-source-map style:_site/style",
|
||||
"start": "npm-run-all build:rm build:sass --parallel watch:*"
|
||||
},
|
||||
"browserslist": [
|
||||
"> 0.25%",
|
||||
"not IE 11"
|
||||
]
|
||||
"dependencies": {
|
||||
"@11ty/eleventy": "^3.0.0",
|
||||
"@11ty/eleventy-img": "^5.0.0",
|
||||
"fast-glob": "^3.3.2"
|
||||
}
|
||||
}
|
||||
|
|
1090
pnpm-lock.yaml
1090
pnpm-lock.yaml
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue