In the past, I talked about how to make your CI builds faster using Drone CI. I don't use DroneCI any more and haven't for a couple years now so I wanted to talk about what I use now.

Now, I use GitLab CI for my CI/CD integrations and builds. By this, I mean client and personal projects. Projects I continue to use GitHub and TravisCI for include:

I prefer GitLab CI for my projects because:

The only real negative I've run into with GitLab CI is that integrating it with a repo that lives on GitHub has been a pain in the past. I liked using the CI enough that I migrated the repository rather than try to debug GitHub's hooks.

GitLab CI is the default for the infrastructure we deploy for our clients at FP Complete, which is how I came to be exposed to it. We will sometimes use Azure Pipelines when we need Windows or macOS support. I hope this post helps if you're making decisions about what CI you use!

Oh, and this blog post was pushed to my static website automatically by GitLab CI.

Here's an example CI/CD deployment configuration for a website I maintain:

stages:
    - build
    - deploy

image: registry.gitlab.com/org/site:latest

staging-deploy:
    stage: deploy
    environment:
        name: staging/$CI_COMMIT_REF_NAME
        url: https://staging.site.com/$CI_COMMIT_REF_NAME/
        on_stop: stop_staging
    script:
        - make deploy-staging
    only:
        - [email protected]/site
    except:
        - [email protected]/site

stop_staging:
    stage: deploy
    environment:
        name: staging/$CI_COMMIT_REF_NAME
        action: stop
    script:
        - make remove-staging
    when: manual

site-deploy:
    stage: deploy
    environment:
        name: site
        url: https://site.com/
    script:
        - make deploy
    only:
        - [email protected]/site

The only changes were a search and replace of $SITE and $ORG. The actual scripts or commands executed live in the Makefile.