Skip to content

Commit

Permalink
update docs when merging to master
Browse files Browse the repository at this point in the history
  • Loading branch information
jesseduffield committed Jul 7, 2019
1 parent da6deff commit 018e151
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .circleci/config.yml
Expand Up @@ -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
Expand Down Expand Up @@ -66,6 +77,11 @@ workflows:
build:
jobs:
- build
- update-docs:
filters:
branches:
only:
- master
release:
jobs:
- release:
Expand Down
22 changes: 22 additions & 0 deletions .circleci/update_docs.sh
@@ -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

0 comments on commit 018e151

Please sign in to comment.