Skip to content

Commit

Permalink
♻️ Refactor the documentation workflow
Browse files Browse the repository at this point in the history
Always run the workflow, but only push to gh-pages on changes to main
  • Loading branch information
AndreMiras committed Dec 3, 2024
1 parent dfd24d8 commit f428b14
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ name: Documentation

on:
push:
branches:
- main
pull_request:

jobs:
deploy:
Expand All @@ -21,7 +20,7 @@ jobs:
git remote set-url origin https://${{github.actor}}:${{github.token}}@github.com/${{github.repository}}.git
- run: yarn install
- run: yarn typedoc src/index.ts --out /tmp/docs
- name: deploy documentation
- name: commit documentation
run: |
git ls-remote --exit-code . origin/gh-pages \
&& git checkout -b gh-pages \
Expand All @@ -31,5 +30,8 @@ jobs:
cp --recursive /tmp/docs/. .
echo /node_modules > .gitignore
git add --all
git commit --all --message ":memo: docs: Update generated documentation"
git commit --all --message ":memo: docs: Update generated documentation" || echo "No changes to commit"
- name: push documentation
if: github.ref_name == 'main'
run: |
git push origin gh-pages

0 comments on commit f428b14

Please sign in to comment.