Filters on branches does not work as expected

Hello,

I try to launch circleci on all the github branches of my project , except one, without success.

What I expect : don’t run circleci on my “gh-pages” branch. In all others cases, run circleci.
What I tried : filters with “ignore” or “only” value + read all the topics about filters errors and tried every responses.

My conf file is very simple, I really don’t understand why it does not work :

version: 2.1

workflows:
  version: 2
  build-and-test:
    jobs:
      - build-and-test:
          filters:
            branches:
              ignore:
                - gh-pages

jobs:
  build-and-test:
    docker:
      - image: circleci/node:12.14.0-browsers
    steps:
      - checkout
      - run: npm ci
      - run: npm test

I have tried many other variants, for example :

      - build-and-test:
          filters:
            branches:
              ignore: gh-pages
              only:
                - dev
                - /tech-.*/
                - /feature-.*/

But every times I got my circleci running after updating my “gh-pages” branch …

How to make the filters work as expected?

If it can help, here is my project link : https://github.com/1024pix/pix-ui

Hi @Anne-Gaelle,

It looks like this error might be caused by not having a config.yml file in your gh-pages branch of your repo. Adding a config.yml file should resolve your issue. Can you give it a try and let me know how it goes.

Hi Henna,

Thank you very much for your answer.
I didn’t think it would be necessary to dupplicate config.yml to my gh-pages.

As the content of my gh-pages is generated automatically, it’s a bit annoying to have to add the config each time. So for now, I will put the tag [skip ci] in my commits for the gh-pages.

Thanks a lot.

You are very welcome. Feel free to follow up here if any additional questions come up.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.