I'm Siegfried. A developer. Yep.

beulogue and gitlab ci

So beulogue is hosted on Gitlab. My blog (private repo) is also there.

Since beulogue is a static site generator, I┬áhave to upload my files myself. Kinda boring. Let’s try Gitlab pipelines !

First, we need to configure some secret variables:

Then, I need to add my public key to the server authorized keys (~/.ssh/authorized_keys relative to the REMOTE_USER home directory).

Here is my .gitlab-ci.yml file:

image: node:6

    - apt-get update -y
    - apt-get -y install rsync
    - echo "${SSH_PRIVATE_KEY}" > id_rsa
    - chmod 700 id_rsa
    - mkdir "${HOME}/.ssh"
    - echo "${SSH_HOST_KEY}" > "${HOME}/.ssh/known_hosts"
    - npm install -g beulogue
    - ./build.sh
    - rsync -r -e 'ssh -i id_rsa' ./output/ ${REMOTE_USER}@${REMOTE_DOMAIN}:${REMOTE_PATH}

Then, each time I push a new article to Gitlab, the pipeline will build the blog and upload it to my server !

Thanks a lot to this article for everything.