Develop dynamically, deploy statically.
- Add the dynstat.yml to your .github/workflows folder.
- Set GitHub Pages "Source" to "Deploy from a branch", select the "gh-pages" branch, and click "Save."
- That's it!
You can configure dynstat by creating a .dynstat.json file.
dirs(default:["."])minify(default:false)skip_empty(default:false) — don't write empty files to build directory?nojekyll(default:true) — create .nojekyll file in build directory?
php_ext(default:[".php"])builds(default:{"build":{}})
Dynstat can create multiple builds, each with their own config. For example, this creates the regular "build" plus a minified version:
{
"minify": false,
"builds": {
"build": {},
"minified": {
"minify": true
}
}
}You can detect that your script is being executed by dynstat to produce a static build by using !empty($_DYNSTAT).
$_DYNSTAT is an array, which provides the following keys:
BUILD_NAME(string)
The minify option is powered by Mecha CMS' Minify Engine.