Skip to content

Commit

Permalink
Split gh-pages at every commit
Browse files Browse the repository at this point in the history
  • Loading branch information
SunSerega committed Apr 25, 2024
1 parent bb7ba8e commit e1fc5dd
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
34 changes: 34 additions & 0 deletions .github/workflows/on commit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,40 @@ permissions:
contents: write

jobs:
update-gh-pages:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@main

- run: |
git config --global core.autocrlf false
git config --global user.name "sun pack bot"
git config --global user.email "[email protected]"
git config --global --add url.https://github.com/.insteadOf "[email protected]:"
branch_name="gh-pages/$(git rev-parse --abbrev-ref HEAD)"
git checkout --orphan "$branch_name"
mv ".git" "Packing/Reference/0Release/"
cd "Packing/Reference/0Release/"
git add .
git commit -m "Split off gh-pages"
git fetch origin
if git show-ref --verify --quiet refs/remotes/origin/$branch_name; then
echo "Remote branch $branch_name found"
if [ -z "$( git diff "origin/$branch_name" )" ]; then
echo "No difference with remote branch"
exit 0
else
echo "Difference found, recreating the branch"
fi
else
echo "Creating new remote branch"
fi
git push -f --set-upstream origin "$branch_name"
pack-win:
runs-on: windows-latest

Expand Down
1 change: 0 additions & 1 deletion Packing/Reference/split.bat

This file was deleted.

0 comments on commit e1fc5dd

Please sign in to comment.