If you have read this blog for any length of time, you know I am a fan of Azure. I thought about using github pages with hexo, but github pages only supports 1 doman name. I could start 301 redirecting my other domains, but I really didn’t want to do that.
Building in azure
In case you didn’t know Azure Webapps have their own build engine called kudu. To get started install the cross plat azure cli. npm install azure-cli -g
Generate your deploy.cmd (or sh if you prefer) azure site deploymentscript
Do not configure anything in the deployment section of your config.yml, this will cause it to publish to the public folder.
The only command you should have to do is hexo generate. Add one of the following to your deploy.cmd or deploy.sh depending on which language you generated (you will want to do this after the script npm installs).
deploy.sh: eval ./node_modules/.bin/hexo generate
deploy.cmd .\node_modules\.bin\hexo.cmd generate
We just need to configure IIS. Drop a file called web.config at the root of your blog. Add the following markup.
This markup will redirect all requests to the public folder, and it will enable newer fonts (like woff). This will also force a trailing slash. Now git commit the project and have azure pick up the files from github/bitbucket/git, etc.