blog.arkey.fr
This blog is generated by Hugo.
Local Setup
brew install asciidoctor
gem install asciidoctor-diagram
brew install hugo
And serve, the ./serve.sh
script runs Hugo and build draft as well as future content.
./serve.sh
This script prepends the $PATH
variable with this repository’s ./bin
folder
in order to trick Hugo to use my custom asciidoctor
script which configures
asciidoctor with wanted options, like -r asciidoctor-diagram
.
exec env PATH=$PWD/bin:$PATH hugo serve --baseUrl=blog.local --bind=0.0.0.0 --buildDrafts
Publish locally
There’s also the publish.sh
script which allows to publish locally the site
and commit the files to the master
branch.
Server
The blog is served by Github Pages, and the job is run by Github Actions.
With the current setup, the HTML files are served from the master
branch.
name: GitHub Pages
on:
push:
branches:
- hugo-sources
jobs:
build-deploy:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
with:
submodules: true
fetch-depth: 0
- name: Build
run: docker run --rm --volume $PWD:/src bric3/hugo-builder hugo # (1)
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
publish_branch: master
publish_dir: ./public
cname: blog.arkey.fr
# force_orphan: true
-
Custom docker builder image
In order to build asciidoc content, I created a custom Docker image, that
install asciidoctor and asciidoctor-diagram, also this Docker image prepends
the $PATH
environment variable in order to customize the asciidoctor configuration.