Update README.md #47
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: '[Push] Documentation Build Commit' | |
on: | |
push: | |
branches: | |
- develop | |
paths: | |
- 'src/**' | |
- 'www/**' | |
jobs: | |
skip_check: | |
name: Skip check | |
runs-on: ubuntu-latest | |
outputs: | |
should_skip: ${{ steps.skip_duplicate.outputs.should_skip }} | |
steps: | |
- id: skip_duplicate | |
uses: fkirc/skip-duplicate-actions@v5 | |
with: | |
cancel_others: 'true' | |
build_docs: | |
name: Documentation build | |
needs: [skip_check] | |
if: needs.skip_check.outputs.should_skip != 'true' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.ref }} | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: lts/* | |
cache: 'npm' | |
- name: Setup | |
run: | | |
npm ci --ignore-scripts | |
cd www/ | |
npm ci --ignore-scripts | |
- name: Clean | |
run: | | |
rm -rf www/docs/API/ | |
- name: Build | |
run: | | |
npm run docs:build | |
npm run format | |
- name: Check changes | |
run: | | |
git add www | |
git diff-index --cached --quiet HEAD || echo "has_changes=true" >> "$GITHUB_ENV" | |
echo ${{ env.has_changes }} | |
- name: Create commit | |
if: env.has_changes == 'true' | |
run: | | |
git config --global user.name 'CI' | |
git config --global user.email '[email protected]' | |
git commit -m "docs: generate documentation" | |
git push |