Skip to content

Commit

Permalink
Updated Deploy workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
p-miano committed Oct 11, 2024
1 parent e171d64 commit 1d68bc2
Showing 1 changed file with 24 additions and 6 deletions.
30 changes: 24 additions & 6 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,27 @@ jobs:
- name: Build the project
run: npm run build

# Step 6: Deploy the built files to GitHub Pages
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
personal_token: ${{ secrets.GITHUB_TOKEN }} # Use personal_token for deployment
publish_dir: ./build
# Step 6: Checkout gh-pages branch
- name: Checkout gh-pages branch
run: |
git fetch
git checkout gh-pages
# Step 7: Copy build files to the gh-pages branch
- name: Copy Build Files
run: |
rsync -av --delete ./build/ ./ # Copy build files into root directory
# Step 8: Copy .github/workflows back to gh-pages
- name: Restore Workflows Directory
run: |
git checkout main -- .github/workflows
# Step 9: Commit and Push changes to gh-pages branch
- name: Commit changes
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add .
git commit -m "Update GitHub Pages with new build and restore workflows [skip ci]" || echo "No changes to commit"
git push origin gh-pages

0 comments on commit 1d68bc2

Please sign in to comment.