Static website deployment to Neocities with automatic minification via GitHub Actions.
-
Get your Neocities API Key:
- Log in to your Neocities account
- Go to your site settings:
https://neocities.org/settings/your-site-name#api_key - Generate or copy your API key
-
Add GitHub Secret:
- Go to your repository on GitHub
- Navigate to Settings → Secrets and variables → Actions
- Click "New repository secret"
- Name:
NEOCITIES_API_TOKEN - Value: Your Neocities API key
- Click "Add secret"
-
Push to main branch:
- The workflow will automatically build, minify, and deploy on every push to
main - You can also manually trigger it via the Actions tab → "Deploy to Neocities" → "Run workflow"
- The workflow will automatically build, minify, and deploy on every push to
# Install dependencies
npm install
# Build and minify files locally
npm run buildThe build script creates a public/ directory with:
- Minified JavaScript files (
.jsfiles) - Minified CSS files (
.cssfiles) - Minified HTML files (
.htmlfiles) - Preserves directory structure (e.g.,
15/subdirectory)
build.js- Build script that minifies all assets.github/workflows/deploy.yml- GitHub Actions workflow for automated deploymentpackage.json- Dependencies and npm scripts