forked from vocdoni/vocdoni-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
77 lines (67 loc) · 2.32 KB
/
docs-update.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
name: Docs update
on:
workflow_call:
push:
branches:
- main
jobs:
job_docs_update:
if: github.actor != 'arabot-1'
permissions: read-all
runs-on: ubuntu-latest
steps:
- name: Checkout vocdoni-sdk repo
uses: actions/checkout@v3
- name: Install node
uses: actions/setup-node@v3
with:
node-version: 18
- name: Install docs dependencies
run: |
yarn
cd ./docs
yarn
- name: Generate Vocdoni SDK Docs
run: |
cd ./docs
yarn build
- name: Get short commit hash
id: vars
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: Checkout developer-portal repo
uses: actions/checkout@v3
with:
repository: vocdoni/developer-portal
ref: main
path: developer-portal
- name: Copy generated docs
run: |
cd ./developer-portal
yarn
export VOCDONI_SDK_PATH=../
yarn copy-sdk-docs
- name: Create PR to developer-portal repo
id: cpr
uses: peter-evans/create-pull-request@v4
with:
token: ${{ secrets.VOCDONIBOT_PAT }}
path: developer-portal
commit-message: "Update vocdoni-sdk docs by commit ${{ steps.vars.outputs.sha_short }}"
committer: "Arabot-1 <[email protected]>"
base: main
branch: update-sdk-docs
#branch-suffix: short-commit-hash ## creates temp update-sdk-docs-xyz branches
delete-branch: true ## true: delete branch after merging
title: Update docs with vocdoni-sdk repo changes
body: |
* This is an automated pull request to upload the updated vocdoni-sdk documentation.
* GitHub Action Run: [${{ github.run_id }}](https://github.com/vocdoni/vocdoni-sdk/actions/runs/${{ github.run_id }})
labels: |
automated pr
reviewers: ${{ github.actor }}
team-reviewers: SdkDocsReviewer
- name: Check PR outputs
if: ${{ steps.cpr.outputs.pull-request-number }}
run: |
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"