From 69c3c2374db2125a2f723094670d3cbf6a23c9e6 Mon Sep 17 00:00:00 2001 From: Luca <129489839+elderguardian@users.noreply.github.com> Date: Thu, 11 Jul 2024 17:14:26 +0200 Subject: [PATCH] Update deploy-pages.yml --- .github/workflows/deploy-pages.yml | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/.github/workflows/deploy-pages.yml b/.github/workflows/deploy-pages.yml index a0b9e9a..0dbd419 100644 --- a/.github/workflows/deploy-pages.yml +++ b/.github/workflows/deploy-pages.yml @@ -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