Merge pull request #767 from etherisc/bugfix/chainnft-name-typo #1375
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: Generate documentation | |
on: | |
push: | |
branches: [main, develop] | |
tags: '*' | |
pull_request: | |
branches: [main, develop] | |
jobs: | |
generate_docs: | |
if: ${{ github.actor != 'dependabot[bot]' }} | |
name: Generate documentation | |
runs-on: ubuntu-latest | |
env: | |
CI_COMMIT_MESSAGE: Continuous Integration Build Artifacts | |
CI_COMMIT_AUTHOR: Continuous Integration | |
permissions: | |
contents: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Install Foundry | |
uses: foundry-rs/foundry-toolchain@v1 | |
- name: Setup node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20' | |
- name: NPM install globals | |
run: npm install -g hardhat-shorthand | |
- name: NPM install | |
run: npm install | |
- name: Generate documentation from source | |
run: hh docgen | |
- name: add and push generated docs to docs branch (PR build) | |
if: ${{ github.event_name == 'pull_request' }} | |
run: | | |
export DOCS_BRANCH_NAME=docs/$GITHUB_HEAD_REF | |
echo $DOCS_BRANCH_NAME | |
git config --global user.name "${{ env.CI_COMMIT_AUTHOR }}" | |
git config --global user.email "[email protected]" | |
git add -f docs/modules/api/pages/ | |
git branch -f $DOCS_BRANCH_NAME | |
git checkout $DOCS_BRANCH_NAME | |
git commit -m "docs: add auto-generated documentation" | |
git push --force origin $DOCS_BRANCH_NAME | |
- name: add and push generated docs to docs branch (branch build) | |
if: ${{ github.event_name != 'pull_request' }} | |
run: | | |
export DOCS_BRANCH_NAME=docs/$GITHUB_REF_NAME | |
echo $DOCS_BRANCH_NAME | |
git config --global user.name "${{ env.CI_COMMIT_AUTHOR }}" | |
git config --global user.email "[email protected]" | |
git add -f docs/modules/api/pages/ | |
git branch -f $DOCS_BRANCH_NAME | |
git checkout $DOCS_BRANCH_NAME | |
git commit -m "docs: add auto-generated documentation" | |
git push --force origin $DOCS_BRANCH_NAME | |