Merge pull request #2426 from jagmoreira/ghp-commit-msg-task

Add current date when publishing via ghp and Invoke
This commit is contained in:
Justin Mayer 2018-10-31 10:32:40 +01:00 committed by GitHub
commit 6af825eae6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -3,6 +3,7 @@
import os import os
import shutil import shutil
import sys import sys
import datetime
try: try:
import socketserver import socketserver
except ImportError: except ImportError:
@ -29,6 +30,7 @@ CONFIG = {
{% if github %} {% if github %}
# Github Pages configuration # Github Pages configuration
'github_pages_branch': '{{github_pages_branch}}', 'github_pages_branch': '{{github_pages_branch}}',
'commit_message': "'Publish site on {}'".format(datetime.date.today().isoformat()),
{% endif %} {% endif %}
# Port for `serve` # Port for `serve`
'port': 8000, 'port': 8000,
@ -108,7 +110,8 @@ def publish(c):
@task @task
def gh_pages(c): def gh_pages(c):
"""Publish to GitHub Pages""" """Publish to GitHub Pages"""
rebuild(c) preview(c)
c.run("ghp-import -b {github_pages_branch} {deploy_path} -p".format( c.run('ghp-import -b {github_pages_branch} '
**CONFIG)) '-m {commit_message} '
'{deploy_path} -p'.format(**CONFIG))
{% endif %} {% endif %}