forked from PolymeshAssociation/polymesh-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
75 lines (72 loc) · 2.11 KB
/
docs.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
name: Docs
on:
push:
branches: [master]
release:
types: [released]
jobs:
docs:
name: Docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: '18.x'
- name: install dependencies
run: yarn --frozen-lockfile
- name: generate docs
run: |
yarn build:docs
yarn build:sdk-docs
- name: determine branch name
uses: actions/github-script@v3
id: setBranch
with:
script: |
const name = process.env.GITHUB_REF.replace(/refs\/.+?\//, '').split('.')[0];
return `docs/${name}`;
result-encoding: string
- name: create branch
uses: peterjgrainger/action-create-branch@v1.0.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
branch: ${{ steps.setBranch.outputs.result }}
continue-on-error: true
- name: un-ignore docs
run: sed -i.bak -e '/^docs\/$/d' .gitignore && rm .gitignore.bak
- name: commit docs and gitignore
uses: EndBug/add-and-commit@v4
with:
add: '.gitignore docs sdk-docs'
message: 'docs: autogenerate documentation'
ref: ${{ steps.setBranch.outputs.result }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload docs to Wiki
uses: SwiftDocOrg/github-wiki-publish-action@v1
with:
path: 'docs'
env:
GH_PERSONAL_ACCESS_TOKEN: ${{ secrets.RELEASE_TOKEN }}
readme:
name: Readme
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '18.x'
cache: 'yarn'
- name: install dependencies
run: yarn --frozen-lockfile
- name: update readme
run: yarn update-readme
- name: commit readme
uses: EndBug/add-and-commit@v4
with:
add: 'README.md'
message: 'docs: update chain version in readme'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}