Posted Tue 25 January 2022

Pelican + Gitlab CI/CD + Gitlab Pages

💡I wanted to setup a place for some of my dev notes. For myself, but also to maybe share?

Pelican site setup

Up and running

If a Makefile was created:

If not:

Theming

Use Gitlab CI/CD to build and deploy to gitlab.io

Configure pelican to work on gitlab pages

Setup .gitlab-ci.yml

Markdown==3.2.2
pelican==4.5.4
image: python:3.7.0

pages:
    stage: deploy
    script:
    - apt-get update -qq && apt-get install -y -qq python python-pip
    - pip install -r requirements.txt
    - make html
    - make publish
    artifacts:
        paths:
            - public/
    only:
    - master

Deploy!

Note: Gitlab docs also require the repo name to be username.gitlab.io, for it's artifact to be deployed to gitlab pages.

Another note: The repo needs to be public for this to work, BUT it can be set up like this: repo visibility config Just make sure Pages is set to Everyone with access.


Tags: how-to pelican python gitlab ci

Comments