Skip to content

Commit 6694718

Browse files
authored
Update deploy-android-documentation.yml v4
1 parent e1ca86d commit 6694718

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

.github/workflows/deploy-android-documentation.yml

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,20 @@ jobs:
4545
run: |
4646
git config --global user.name "github-actions[bot]"
4747
git config --global user.email "github-actions[bot]@users.noreply.github.com"
48-
git checkout --orphan gh-pages
49-
git rm -rf .
50-
mv ./kv-color-palette/build/docs/dokkaHtml/* .
51-
touch .nojekyll # Prevents GitHub from treating it as a Jekyll site
48+
49+
# Check if gh-pages exists
50+
if git ls-remote --exit-code --heads origin gh-pages; then
51+
git fetch origin gh-pages
52+
git checkout gh-pages
53+
git rm -rf .
54+
else
55+
git checkout --orphan gh-pages
56+
fi
57+
58+
# Move new documentation
59+
rsync -av --delete kv-color-palette/build/docs/dokkaHtml/ .
60+
61+
touch .nojekyll # Prevent GitHub from treating it as a Jekyll site
5262
git add .
53-
git commit -m "Deploy Dokka documentation"
63+
git commit -m "Deploy Dokka documentation" || echo "No changes to commit"
5464
git push --force origin gh-pages

0 commit comments

Comments
 (0)