-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
emptied it
- Loading branch information
Showing
1 changed file
with
0 additions
and
32 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1 @@ | ||
--- | ||
name: Build and Deploy React Website | ||
on: | ||
push: | ||
branches: | ||
- main | ||
jobs: | ||
build-and-deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
- name: Install dependencies | ||
run: npm install | ||
- name: Build React app | ||
run: npm run build | ||
- name: Deploy to GitHub Pages | ||
uses: actions/github-script@v6 | ||
with: | ||
script: | | ||
# Create the gh-pages branch if it doesn't exist | ||
git checkout -b gh-pages || git checkout gh-pages | ||
|
||
# Copy the build files to the gh-pages branch | ||
cp -r build/* . | ||
# Commit and push the changes | ||
git add . | ||
git commit -m "Deploy React website" | ||
git push origin gh-pages | ||
# Return to the main branch | ||
git checkout main |