Update deploy.yml #7
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy React App | |
on: | |
push: | |
branches: [ main ] # Trigger on push to main branch | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '14' # or your preferred Node.js version | |
- name: Install dependencies | |
run: npm ci | |
- name: Build | |
run: npm run build | |
- name: Deploy to GitHub Pages | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
personal_token: ${{ secrets.PAT }} # Use PAT instead of GITHUB_TOKEN | |
publish_dir: ./build | |
publish_branch: gh-pages | |
allow_empty_commit: false | |
keep_files: false | |
force_orphan: false | |
enable_jekyll: false | |
disable_nojekyll: false | |
exclude_assets: .github |