GENERATE DOCS TEST pt-3 #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: Generate Docs | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
generate-docs: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v3 | |
- name: Install dependencies | |
run: npm install | |
- name: Generate TypeDoc | |
run: npm run docs | |
- name: Checkout docs-repo | |
uses: actions/checkout@v3 | |
with: | |
repository: rage-js/docs | |
token: ${{ secrets.PAT_TOKEN }} | |
path: rage-js-docs | |
ref: docs | |
- name: Copy docs to rage-js-docs | |
run: | | |
rm -rf rage-js-docs/core-docs | |
mv docs core-docs | |
cp -R core-docs rage-js-docs/ | |
- name: Commit and push changes to rage-js-docs | |
run: | | |
cd rage-js-docs | |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
git config --local user.name "Github Actions" | |
if git diff --quiet; then | |
echo "No changes to commit" | |
else | |
git add . | |
git commit -m "Update docs" | |
git push origin docs --force | |
fi | |
env: | |
GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }} |