I am seeing this error:
Build-agent version 0.0.4761-f18e895 (2018-03-20T01:12:48+0000)
Configuration errors: 1 error occurred:
* Cannot find a job named `build` to run in the `jobs:` section of your configuration file.
If you expected a workflow to run, check your config contains a top-level key called 'workflows:'
I understand from the docs that I only have to have a job called build if I am NOT using workflows. I am using workflows, there is a workflows key.
What is wrong?
My full .circleci/config.yml
:
Javascript Node CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-javascript/ for more details
#
version: 2
jobs:
deploy:
working_directory: ~/TryGhost/spirit
docker:
# CircleCI maintains a library of pre-built images
# documented at https://circleci.com/docs/2.0/circleci-images/
# This is closest to our current server version
- image: circleci/node:6.13.0
steps:
- checkout
# Make sure CircleCI can access our server
- run: ssh-keyscan $PRD_SERVER >> ~/.ssh/known_hosts
# Dependencies
# Restore the dependency cache
- restore_cache:
keys:
# This branch if available
- v1-dep-{{ .Branch }}-
# Default branch if not
- v1-dep-master-
# Any branch if there are none on the default branch - this should be unnecessary if you have your default branch configured correctly
- v1-dep-
# Install dependencies
- run: yarn
# Save dependency cache
- save_cache:
key: v1-dep-{{ .Branch }}-{{ epoch }}
paths:
- ~/.cache/yarn
- ./node_modules
# Deploy!
- run: yarn deploy production
# Start here! This defines what actually happens and when
workflows:
version: 2
deploy:
jobs:
- deploy:
# This context loads the user & ips for staging & production
context: GhostOrg
filters:
# Only deploy on tags
tags:
only: /^v.*/
I’ve run into this error 4 or 5 times whilst setting up configs and each time I keep fixing it, seemingly, by deleting and re-adding whitespace and retrying.
Am I going mad?