CircleCI not building from a tagged release


#1

I have this working in another repository, but it’s not working for a current repository I am working on. I have ensured all settings are the same as the repository that correctly fires off a CircleCI build upon a tagged release.

I also ensured that Github is sending the Webhook … here is part of the payload:

{
  "ref": "v0.0.1-alpha",
  "ref_type": "tag",
  "master_branch": "master",
  "description": "The frontend application",
  "pusher_type": "user",

Here is my .circleci/config.yml:

version: 2
workflows:
  version: 2
  install_deps_build_and_deploy:
    jobs:
      - install_deps
      - build_and_deploy:
          requires:
            - install_deps
          filters:
            tags:
              only: /^v.*/
            branches:
              ignore: /.*/
jobs:
  install_deps:
    docker:
      - image: circleci/node:10.12
    steps:
      - checkout
      - restore_cache:
          keys: 
            - node_modules-{{ .Branch }}-{{ checksum "yarn.lock" }}
      - run:
          name: Install dependencies.
          command: yarn install
      - save_cache:
          key: node_modules-{{ .Branch }}-{{ checksum "yarn.lock" }}
          paths:
            - "node_modules"
  build_and_deploy:
    docker:
      - image: circleci/node:10.12
    steps:
      - checkout
      - restore_cache:
          keys: 
            - node_modules-{{ .Branch }}-{{ checksum "yarn.lock" }}
      - run:
          name: Build the application.
          command: yarn build
      - run:
          name: Upload assets to S3.
          command: make docker-upload-s3 > /dev/null
      - run:
          name: Login to docker.
          command: docker login -u $CC_DOCKER_USER -p $CC_DOCKER_PASS > /dev/null
      - run:
          name: Build the docker image.
          command: make docker-build-pm2
      - run:
          name: Push the docker image.
          command: make docker-push-pm2
      - add_ssh_keys:
          fingerprints:
            - "xx"
            - "xx"
            - "xx"
      - run:
          name: Deploy pm2 applications.
          command: make remote-deploy-pm2
      - run:
          name: Deploy the nginx application!
          command: make docker-reload-nginx

What is going on? FYI, when I push to master, the workflow install_deps runs (which is expected).


#2

Just a quick look I notice you wrote .circleci/config.yaml The file name must be .circleci/config.yml Could you see if maybe that is the only issue?


#4

Does this tag already exist? It needs to be a new tag with a new tag name every time to test this.


#5

It is config.yml – that was a typo on my part. I will update the description.


#6

Oops, I updated the post … I added:

when I push to master, the workflow install_deps runs (which is expected).


#7

The tag does not already exist It is a new tag. Additionally I created release tags for v0.0.2-alpha, v0.0.3-alpha and v0.0.4-alpha and nothing started a new workflow…


#8

Could you try this? I added an additional filter.
If you want to trigger a job from tag creation, the top level job needs to have a tag filer.

  - install_deps
      filters:
        tags:
          only: /^v.*/
        branches:
          ignore: /.*/
  - build_and_deploy:
      requires:
        - install_deps
      filters:
        tags:
          only: /^v.*/
        branches:
          ignore: /.*/

#10

Ok, so I figured it out … I was requiring install_deps run in the build_and_deploy job, but I was filtering install_deps so that it did not get run on a tagged build…

Thanks everyone!