Principle
I write short content in a simple plain text markup and commit it to a git repository. From there runs a CI pipeline that uses a static site generator to build a homepage with this content.
Afterwards the CI pipeline pushes the generated html files of my homepage with sftp to my webserver.
Used Software
-
hugo static site builder
-
asciidoctor markup renderer
-
gitlab git repository
-
gitlab ci pipeline
-
a hugo docker container image for the ci pipeline
-
lftp sftp command line tool
Steps
manual steps
-
edit asciidoc content locally
... draft: false toc: true --- * hugo static site builder * git with a gitlab repository ...
-
optional: test the homepage locally
.\hugo server -D
Start building sites …
hugo v0.124.1-db083b05f16c945fec04f745f0ca8640560cf1ec+extended windows/amd64 BuildDate=2024-03-20T11:40:10Z VendorInfo=gohugoio
INFO build: step process substep collect files 64 files_total 64 duration 100.3991ms
INFO build: step process duration 101.9926ms
INFO build: step assemble duration 145.4019ms
INFO Rendering blog\2017-10-07-3GotchasInOneDayJdk9.adoc using asciidoctor args
...
INFO build: step render pages 166 content 104 duration 8.8704937s
INFO build: step postProcess duration 0s
INFO build: duration 9.1201305s
| DE
-------------------+------
Pages | 157
Paginator pages | 9
Non-page files | 13
Static files | 68
Processed images | 0
Aliases | 48
Cleaned | 0
Total in 10894 ms
-
git push to gitlab repo
automated steps
-
using a gitlab ci pipeline
pages:
environment:
name: homepage
stage: generate
image: hugomods/hugo:ci
when: always
script:
- hugo version
- hugo
artifacts:
name: "$CI_JOB_STAGE-$CI_COMMIT_REF_NAME-gitlabpages"
expire_in: 2 days
paths:
- public
-
a sftp copy step to deploy my homepage
lftp -u "user","pw" sftp://hostsample.com -e "set ssl:verify-certificate no; mirror --reverse --verbose ./public /; quit"
this will transfer all files generated in /public to my homepage / (without deleting stale old files).