Skip to content

v1.0.5 - Updated documentation and added Accessibility.html page, Add… #96

v1.0.5 - Updated documentation and added Accessibility.html page, Add…

v1.0.5 - Updated documentation and added Accessibility.html page, Add… #96

Workflow file for this run

name: Deploy to Hostinger
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
# 1. Build: Run custom build script (creates dist, inlines CSS, bundles JS)
- name: Build Production Assets
run: node .github/scripts/build.js --src . --dist ./dist
# 2. Minify: Compress bundled assets
- name: Minify Assets
run: |
npm install terser html-minifier-terser --no-save
# Minify JS bundle
npx terser dist/app.bundle.js \
--compress --mangle \
--comments '/^!/' \
-o dist/app.bundle.js
# Minify theme-loader.js
npx terser dist/themes/theme-loader.js \
--compress --mangle \
--comments '/^!/' \
-o dist/themes/theme-loader.js
# Minify all HTML files recursively
find dist -name "*.html" -type f | while read html; do
echo "Minifying $html..."
npx html-minifier-terser "$html" \
--collapse-whitespace \
--remove-comments \
--ignore-custom-comments "^!" \
--minify-css true \
--minify-js true \
-o "$html"
done
# 3. Deploy: Upload dist folder via FTP
- name: FTP Deploy
uses: SamKirkland/FTP-Deploy-Action@v4.3.4
with:
server: ${{ secrets.FTP_SERVER }}
username: ${{ secrets.FTP_USERNAME }}
password: ${{ secrets.FTP_PASSWORD }}
local-dir: ./dist/
server-dir: /
exclude: |
**/.git*
**/.DS_Store
**/.build-manifest.json