[Workflows] Config does not conform to schema

circle.yml
workflow

#1

Hi everybody.

I’m new to circle ci since today, and I encountered an error that I can’t understand.
I want to use th workflows feature to build and deploy a docker image at each git tag.

But, the circle ci app said me that:

Config does not conform to schema: {:workflows {:build_and_deploy {:jobs [{:build (not (map? nil)), :filters {:tags disallowed-key}}]}}}

And this is my config.yml file

version: 2
jobs:
  build:
    docker:
      image: myRegistry.com/pawndev_ci:latest
      environment:
        - LETSENCRYPT_HOST="www.pawndev.com"
        - LETSENCRYPT_EMAIL="coquelet.c@gmail.com"
        - VIRTUAL_HOST="www.pawndev.com"
        - VIRTUAL_PORT=80

    steps:
      - checkout
      - run:
        name: envsubst var
        command: envsubst < .env.prod.dist > .env
      - run:
        name: build project image
        command: docker build -f Dockerfile.prod -t pawndev_portfoliov1:{{ CIRCLE_TAG }} .
      - run:
        name: tag image
        command: docker tag pawndev_portfoliov1:{{ CIRCLE_TAG }} myRegistry.com/pawndev_portfoliov1:{{ CIRCLE_TAG }}
      - run:
        name: push image to registry
        command: docker push myRegistry.com/pawndev_portfoliov1:{{ CIRCLE_TAG }}
      - run:
        name: deploy to rancher server
        command: rancher-compose -f docker-compose.prod.yml up -d

workflows:
  version: 2
  build_and_deploy:
    jobs:
      - build:
        filters:
          tags:
            only: /.*/

Thanks for your help


#2

I think you’re missing a - before the image key:

jobs:
  build:
    docker:
      - image: myRegistry.com/pawndev_ci:latest
        environment:
          - LETSENCRYPT_HOST="www.pawndev.com"
          - LETSENCRYPT_EMAIL="coquelet.c@gmail.com"
          - VIRTUAL_HOST="www.pawndev.com"
          - VIRTUAL_PORT=80

And you might need to remove the - before the env variable names. This works for me: https://github.com/decidim/decidim/blob/master/.circleci/config.yml#L3-L16


#3