I wanted to test an easier and faster way to write things on this website instead of going through commits, PRs, and push and I thought of giving a try to a headless CMS.

I searched for a bit online and I found a lot of them but one immediately caught my attention: pagescms. I tried it and I am actually writing this from that.

Given that it only works with Github I decided to move this site from GitLab to Github. Before I used GitLab pages and I just added a DNS config in Cloudflare to point to the domain given by GitLab.

Now I have a repo on Github with a simple action that runs on main:

on:
  push:
    branches: ["main"]
jobs:
  deploy:
    runs-on: ubuntu-latest
    permissions:
      contents: read
      deployments: write
    name: Deploy to Cloudflare Pages
    steps:
      - name: Checkout
        uses: actions/checkout@v3
      - uses: ruby/setup-ruby@v1
        with:
          ruby-version: '2.6'
      - name: Setup Environment.
        run: |
          gem install bundler -v 2.4.22
          bundle install
      - name: Build Site with Jekyll.
        run: JEKYLL_ENV=production bundle exec jekyll build
      - name: Publish
        uses: cloudflare/pages-action@v1
        with:
          apiToken: $
          accountId: $
          projectName: notes # e.g. 'my-project'
          directory: _site # e.g. 'dist'
          gitHubToken: $

This action does the build of the project and then uploads it to Cloudflare pages.

So far so good.