Skip to content

Commit

Permalink
Update static.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
ColinWu0403 committed Jul 18, 2024
1 parent 2fc9a55 commit b2c8abc
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions .github/workflows/static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,18 +59,21 @@ jobs:
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
# Initialize a new Git repository in the dist directory
git init
# Add remote repository
git remote add origin https://github.com/${{ github.repository }}.git
# Create or switch to the gh-pages branch
git checkout -b gh-pages
# Initialize Git if not already initialized
if [ -z "$(ls -A .git)" ]; then
git init
git remote add origin https://github.com/${{ github.repository }}.git
fi
# Checkout or create gh-pages branch
git fetch origin gh-pages || git checkout --orphan gh-pages
# Add and commit the build files
# Add all files
git add .
# Commit changes
git commit -m "Deploy to GitHub Pages"
# Force push to the gh-pages branch
# Force push to gh-pages branch
git push --force origin gh-pages

0 comments on commit b2c8abc

Please sign in to comment.