Here's how I set make deploy
to only deploy to Heroku when:
- pyflakes reports no issues in Python modules
- git index is clean (does not check untracked files)
- configuration STATIC_VERSION is bumped if static files changed
I have app.config['SEND_FILE_MAX_AGE_DEFAULT'] = 2592000
to aggressively cache files. For STATIC_VERSION, I have Flask serve static file from a version based URL:
app = Flask(__name__, static_url_path='/static/%s' % static_version)
This is for http://pug.io/, but these are patterns I use in a lot of my projects. I often have a database target to setup a local development sqlite database, but left that out in this Makefile.