File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change 106106
107107lane :deploy_api_reference do
108108 sh ( "../tools/make-doc.sh" ) # dependency on Jazzy
109- sh ( "cd ../build/doc && git add . && git commit -m 'update api reference' && git push" ) # push to gh-pages
109+ if are_doc_files_changed ( ) # push to gh-pages if files have been changed
110+ sh ( "cd ../build/doc git add . && git commit -m 'update api reference' && git push" )
111+ else
112+ puts "No files were changed for the api documentation, so no need to push to gh-pages"
113+ end
110114end
111115
112116def prepare_git ( branch )
@@ -127,6 +131,11 @@ def prepare_git(branch)
127131 # git_pull
128132end
129133
134+ def are_doc_files_changed ( )
135+ git_status = sh ( "cd ../build/doc && git status --porcelain" )
136+ return !git_status . to_s . strip . empty?
137+ end
138+
130139def prepare_api_keys ( )
131140 xcargs = [ ]
132141 api_key = ENV [ "ALGOLIA_API_KEY" ]
You can’t perform that action at this time.
0 commit comments