forked from esoterictemplates/template
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f41da13
commit 0239bfc
Showing
1 changed file
with
10 additions
and
3 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 . | ||
|
@@ -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/* | ||
|