Gh-pages not being ignored

I keep getting an annoying “build failed” email seemingly because the git push in my deploy step is triggering a build on the gh-pages branch which I want to be ignored by circle-ci. As you can see in my config, I’ve specified to only build the master branch. Seems like a bug?

Here is my (condensed) config.yml

version: 2
jobs:
    build:
        branches:
            only:
                - master
        docker:
            - image: circleci/node:10-stretch
        steps:
            - checkout
            - deploy:
                name: Deploy
                command: |
                    cd docs/.vuepress/dist
                    echo 'docs.lipsurf.com' > CNAME
                    git config --global user.email "circleci@lipsurf.com"
                    git config --global user.name "Circle CI"
                    git init
                    git add -A
                    git commit -m 'deploy'
                    git push -f git@github.com:lipsurf/plugins.git master:gh-pages

The commit to the GH-pages branch will have no config.yml present, so the branch filter isn’t present when we receive notification of the push.

The thing to do is to add [ci skip] to your commit message on the GH-pages branch. This will cause the build to be skilled.

1 Like

Cool! That worked like a charm!

Shouldn’t there be a way to set up the config file in the gh-pages branch so that Circleci understands there is nothing to be done here? It just feels strange to have to copy the jobs from the master branch to gh-pages and then setup a filter to ignore the job. So what I am asking for is a simple noop config. I tried:

version: 2
jobs:

but that still gives:

#!/bin/sh -eo pipefail
# ERROR IN CONFIG FILE:
# [#] required key [jobs] not found
# 
# -------
# Warning: This configuration was auto-generated to show you the message above.  
# Don't rerun this job. Rerunning will have no effect.
false

I’m still seeing a failure, even when using [skip ci] for commits to the gh-pages branch :disappointed:

(this is from a tool that will wipe a config, so I can’t just push a Circle config, even a dummy one, to that branch).