Skip to content

Commit

Permalink
🐛 give perms to write
Browse files Browse the repository at this point in the history
  • Loading branch information
slooi committed Sep 7, 2024
1 parent 650418c commit 690917b
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ name: Deploy Vite App to GitHub Pages

on:
push:
branches: [master]
branches: [master] # Changed from 'main' to 'master' to match your repository

permissions:
contents: write # This line gives the workflow permission to write to your repository

jobs:
build-and-deploy:
Expand All @@ -23,15 +26,13 @@ jobs:
run: npm run build

- name: Deploy to GitHub Pages
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config --global user.name 'GitHub Actions'
git config --global user.email '[email protected]'
git checkout --orphan gh-pages
git --work-tree dist add --all
git --work-tree dist commit -m "Deploy to GitHub Pages"
git push origin HEAD:gh-pages --force
git push origin gh-pages --force
rm -rf dist
git checkout -f main
git checkout -f master
git branch -D gh-pages

0 comments on commit 690917b

Please sign in to comment.