feat: deploy docs to github pages when PR merged

This commit is contained in:
debugtalk
2021-11-19 15:03:39 +08:00
parent 27bf88de2a
commit 9e15b2161d

View File

@@ -1,19 +1,25 @@
name: Deploy docs to GitHub Pages
on:
push:
branches:
- main
pull_request:
branches: [main]
types: [closed]
jobs:
deploy:
name: Deploy docs to GitHub Pages
if: ${{ github.event.pull_request.merged }} # true
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- name: Checkout code
uses: actions/checkout@v2
- name: Setup python3 env
uses: actions/setup-python@v2
with:
python-version: 3.x
- run: pip install mkdocs-material # including mkdocs
- run: go test docs/cmd/doc_test.go # update hrp cli docs
- run: mkdocs gh-deploy --force
- name: Install mkdocs and material design
run: pip install mkdocs-material # including mkdocs
- name: Update hrp cli docs
run: go test docs/cmd/doc_test.go # update hrp cli docs
- name: Deploy docs to github pages
run: mkdocs gh-deploy --force