Skip to content

Commit

Permalink
Attempt to fix dokka.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
esotericenderman authored Feb 5, 2025
1 parent f41da13 commit 0239bfc
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions .github/workflows/dokka.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,16 @@ jobs:
run: gradle dokkaJavadoc
- name: Generate Dokka GFM files
run: gradle dokkaGfm
- name: Deploy to GitHub Pages
if: github.ref == 'refs/heads/main'
run: |
- name: Deploy to GitHub Pages
if: github.ref == 'refs/heads/main'
run: |
git config --global user.name "GitHub Actions"
git config --global user.email "[email protected]"
# Check if gh-pages branch exists remotely
# Check if gh-pages exists remotely, otherwise create it
if ! git ls-remote --exit-code --heads origin gh-pages; then
git checkout --orphan gh-pages
git rm -rf .
Expand All @@ -47,10 +50,14 @@ jobs:
git add README.md
git commit -m "Initial commit for GitHub Pages"
git push origin gh-pages
git checkout main # Return to main branch before adding worktree
fi
# Use a separate directory for the gh-pages worktree
git worktree add gh-pages-dir gh-pages
# Ensure the worktree does not already exist
rm -rf gh-pages-dir
# Add gh-pages as a worktree
git worktree add gh-pages-dir origin/gh-pages
# Ensure it's clean
rm -rf gh-pages-dir/*
Expand Down

0 comments on commit 0239bfc

Please sign in to comment.