Skip to content

Commit df43248

Browse files
committed
Automate docs release
1 parent ae42433 commit df43248

File tree

2 files changed

+57
-0
lines changed

2 files changed

+57
-0
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Push Docs
2+
description: Push Docs to Heroku
3+
inputs:
4+
heroku-api-token:
5+
description: API token for Heroku
6+
required: true
7+
heroku-app-name:
8+
description: App name
9+
required: true
10+
commit_user_name:
11+
description: Name used for the commit user
12+
required: false
13+
default: GitHub Actions
14+
commit_user_email:
15+
description: Email address used for the commit user
16+
required: false
17+
18+
runs:
19+
using: "composite"
20+
steps:
21+
- run: |
22+
git checkout -b inv-push-docs
23+
git add docs/examples/vendor/*.py -f
24+
git -c user.name="${{ inputs.commit_user_name }}" -c user.email="${{ inputs.commit_user_email }}" commit -m "Add examples" --allow-empty
25+
git subtree split --prefix docs -b inv-push-docs-subtree
26+
git push -f https://heroku:${{ inputs.heroku-api-token }}@git.heroku.com/${{ inputs.heroku-app-name }}.git inv-push-docs-subtree:master
27+
git checkout master
28+
git branch -D inv-push-docs inv-push-docs-subtree
29+
shell: bash

.github/workflows/build-docs.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Build docs
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
paths:
8+
- docs/**
9+
- examples/**
10+
11+
jobs:
12+
build_docs:
13+
name: Build and release documentation
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v2
17+
- name: Set up Python 3.8
18+
uses: actions/setup-python@v1
19+
with:
20+
python-version: 3.8
21+
- name: Install Python dependencies
22+
run: python -m pip install invoke semver termcolor
23+
- name: Copy examples to docs/
24+
run: invoke copy-examples
25+
- uses: ./.github/actions/push_docs
26+
with:
27+
heroku-api-token: ${{ secrets.HEROKU_API_TOKEN }}
28+
heroku-app-name: ${{ secrets.HEROKU_APP_NAME }}

0 commit comments

Comments
 (0)