Slight rework of theme loading, minor update to css on small screens,… #94
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 (contains embedded theme) | |
| npx terser dist/themes/theme-loader.js \ | |
| --compress --mangle \ | |
| --comments '/^!/' \ | |
| -o dist/themes/theme-loader.js | |
| # Minify all HTML files (includes inlined CSS) | |
| for html in dist/*.html; do | |
| 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 |