Skip to content

Commit

Permalink
Merge pull request #35 from elderguardian/elderguardian-patch-1
Browse files Browse the repository at this point in the history
Update deploy-pages.yml
  • Loading branch information
elderguardian authored Jul 11, 2024
2 parents 52e3a5c + 69c3c23 commit fd96b49
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions .github/workflows/deploy-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,21 @@ jobs:
- name: Compile
run: php src/main.php

- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: gh-pages
publish_dir: ./dist
- name: Deploy to gh-pages branch
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
# Clone the gh-pages branch
git clone --branch=gh-pages https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }} gh-pages
cd gh-pages
# Copy contents of dist to the gh-pages branch
cp -r ../dist/* .
# Add all files to git
git add .
# Commit and push changes
git commit -m 'Deploy to GitHub Pages' || echo "No changes to commit"
git push

0 comments on commit fd96b49

Please sign in to comment.