From 19c32a29893c31763d3c643fd831f2d195411c0e Mon Sep 17 00:00:00 2001 From: Anshul Guleria Date: Mon, 13 Apr 2020 20:33:49 +0530 Subject: [PATCH] docs: add github action to generate doc (#1522) Added github action install dependencies required to generate documentation and then run the documentation generator. As a final step publish the changes to `gh-pages` branch which will be the source for github documentation. Adds badge for doc-generator github action closes: https://github.com/kulshekhar/ts-jest/issues/1494 Co-authored-by: Anshul Guleria --- .github/workflows/doc-generator.yml | 54 +++++++++++++++++++++++++++++ README.md | 10 +++++- 2 files changed, 63 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/doc-generator.yml diff --git a/.github/workflows/doc-generator.yml b/.github/workflows/doc-generator.yml new file mode 100644 index 0000000000..edeae20bc9 --- /dev/null +++ b/.github/workflows/doc-generator.yml @@ -0,0 +1,54 @@ +# This is a basic workflow to help you get started with Actions + +name: doc-generator + +# Controls when the action will run. Triggers the workflow on push or pull request +# events but only for the master branch +on: + push: + branches: [ master ] + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "build" + build: + # The type of runner that the job will run on + runs-on: ubuntu-latest + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + - name: install plantuml + run: | + sudo apt-get update -y + sudo apt-get install -y plantuml + + - uses: actions/setup-ruby@v1.0.0 + + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v2 + + - name: setup bundler and install dependencies + run: | + gem install bundler:1.17.3 + cd docs + bundle install + + - name: link documentation + # gets gh-pages branch and links that to docs/_site directory + run: | + git fetch --no-tags --prune --progress --no-recurse-submodules --depth=1 origin gh-pages + git worktree add docs/_site gh-pages + + - name: generate documentation + run: | + cd docs + bundle exec jekyll build + + - name: push generated documentation + run: | + cd docs/_site + git config user.name "Doc Bot" + git config user.email noreply@github.com + git add . + git commit -m "[BOT] 🤖 updates doc. No humans needed." + git push diff --git a/README.md b/README.md index e8e51e25cb..de186621a1 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,12 @@ -# ts-jest [![npm version](https://badge.fury.io/js/ts-jest.svg)](https://badge.fury.io/js/ts-jest) [![NPM downloads](https://img.shields.io/npm/dm/ts-jest.svg?style=flat)](https://npmjs.org/package/ts-jest) [![Known Vulnerabilities](https://snyk.io/test/github/kulshekhar/ts-jest/badge.svg)](https://snyk.io/test/github/kulshekhar/ts-jest) [![Coverage Status](https://coveralls.io/repos/github/kulshekhar/ts-jest/badge.svg?branch=master)](https://coveralls.io/github/kulshekhar/ts-jest?branch=master) [![Dependabot Status](https://api.dependabot.com/badges/status?host=github&repo=kulshekhar/ts-jest)](https://dependabot.com) [![Build Status](https://travis-ci.com/kulshekhar/ts-jest.svg?branch=master)](https://travis-ci.com/kulshekhar/ts-jest) +# ts-jest + +[![npm version](https://badge.fury.io/js/ts-jest.svg)](https://badge.fury.io/js/ts-jest) +[![NPM downloads](https://img.shields.io/npm/dm/ts-jest.svg?style=flat)](https://npmjs.org/package/ts-jest) +[![Known Vulnerabilities](https://snyk.io/test/github/kulshekhar/ts-jest/badge.svg)](https://snyk.io/test/github/kulshekhar/ts-jest) +[![Coverage Status](https://coveralls.io/repos/github/kulshekhar/ts-jest/badge.svg?branch=master)](https://coveralls.io/github/kulshekhar/ts-jest?branch=master) +[![Dependabot Status](https://api.dependabot.com/badges/status?host=github&repo=kulshekhar/ts-jest)](https://dependabot.com) +[![Build Status](https://travis-ci.com/kulshekhar/ts-jest.svg?branch=master)](https://travis-ci.com/kulshekhar/ts-jest) +[![doc-generator](https://github.com/kulshekhar/ts-jest/workflows/doc-generator/badge.svg)](https://github.com/kulshekhar/ts-jest/actions)