remove action
This commit is contained in:
parent
57f3367597
commit
f189fcfff0
@ -1,50 +0,0 @@
|
||||
name: Minify HTML and CSS
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
minify:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Set up Node.js
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 18
|
||||
|
||||
- name: Install minification tools
|
||||
run: |
|
||||
npm install -g html-minifier-terser csso-cli terser
|
||||
|
||||
- name: Minify HTML files
|
||||
run: |
|
||||
find src/ -name '*.html' ! -name '*min*' -exec sh -c 'html-minifier-terser --collapse-whitespace --remove-comments --minify-js true --minify-css true -o "${0%.html}.min.html" "$0"' {} \;
|
||||
|
||||
- name: Minify CSS files
|
||||
run: |
|
||||
find src/css/ -name '*.css' ! -name '*min*' -exec sh -c 'csso "$0" --output "${0%.css}.min.css"' {} \;
|
||||
|
||||
- name: Minify JS files
|
||||
run: |
|
||||
find src/ -name '*.js' ! -name '*min*' -exec sh -c 'terser --compress --mangle --output "${0%.js}.min.js" "$0"' {} \;
|
||||
|
||||
- name: Commit and push changes
|
||||
env:
|
||||
USERNAME_GITEA: ${{ secrets.USERNAME_GITEA }}
|
||||
TOKEN_GITEA: ${{ secrets.TOKEN_GITEA }}
|
||||
run: |
|
||||
git config --global user.name "LibreCloud Actions Bot"
|
||||
git config --global user.email "git@pontusmail.org"
|
||||
git remote set-url origin https://${USERNAME_GITEA}:${TOKEN_GITEA}@git.pontusmail.org/aidan/aidxnFUNretro.git
|
||||
git add .
|
||||
git commit -m "[bot] Minifying HTML and CSS automatically"
|
||||
git push origin main
|
Loading…
x
Reference in New Issue
Block a user