Trigger Heroku build even if there are no code changes

I have the following yml file
version: 2.1
jobs:
build:
docker:
- image: circleci/node:13.12.0
working_directory: ~/repo
steps:
- checkout
- run:
name: update npm
command: ‘sudo npm install -g npm@latest’
- restore_cache:
key: dependency-cache-{{ checksum “package.json” }}
- run:
name: Install node modules
command: npm install
- run:
name: Build
command: npm run build
- save_cache:
key: dependency-cache-{{ checksum “package.json” }}
paths:
- ./node_modules
- run:
name: Deploy Master to Heroku
command: |
git push https://heroku:$HEROKU_API_KEY@git.heroku.com/$HEROKU_APP_NAME.git master:main -f

This pipeline is set up to be triggered by changes in Contentful CMS, however, because there are no code changes, the build stops and says “Everything is up to date”. Is there someway where I can forcibly run a Heroku build even if there is no code changes?

Hi @harrygothold,

I am looking at contentful’s docs here: https://www.contentful.com/developers/docs/ruby/tutorials/automated-rebuild-and-deploy-with-circleci-and-webhooks/
It looks like a build is triggered via contentful using CircleCI’s API anytime a change is made. You should be able to trigger a heroku build if you re-run you build from within CircleCI’s UI.

You can leverage CircleCI’s API to trigger a pipeline: https://circleci.com/docs/api/v2/#operation/triggerPipeline

You can also use tag filtering to trigger a job or workflow when a commit is tagged.

Lastly, you could schedule a workflow to deploy automatically.

Please feel free to provide additional details or a build link if there is anything I missed.