update docs when merging to master

pull/114/head
Jesse Duffield 5 years ago
parent da6deff199
commit 018e151e1f

@ -36,6 +36,17 @@ jobs:
paths:
- ~/.cache/go-build
update-docs:
docker:
- image: circleci/golang:1.12
working_directory: /go/src/github.com/jesseduffield/lazydocker
steps:
- checkout
- run:
name: Update docs
command: |
./.circleci/update_docs.sh
release:
docker:
- image: circleci/golang:1.12
@ -66,6 +77,11 @@ workflows:
build:
jobs:
- build
- update-docs:
filters:
branches:
only:
- master
release:
jobs:
- release:

@ -0,0 +1,22 @@
#!/bin/bash
set -ex
# see if we have a new cheatsheet
# if other docs end up being generated automatically we can chuck in the relevant scripts here
go run scripts/generate_cheatsheet.go
# commit and push if we have a change
if [[ -z $(git status -s -- docs/*) ]]; then
echo "no changes to commit in the docs directory"
exit 0
fi
echo "committing updated docs"
git config user.name "lazydocker bot"
git config user.email "jessedduffield@gmail.com"
git add docs/*
git commit -m "update docs"
git push -u origin HEAD
Loading…
Cancel
Save