Merge pull request #23 from PolymeshAssociation/fix/update-readme #3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |