-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
9 additions
and
6 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,4 +1,4 @@ | ||
name: Deploy React App to GitHub Pages | ||
name: Build and Deploy React App to GitHub Pages | ||
|
||
on: | ||
push: | ||
|
@@ -21,19 +21,22 @@ jobs: | |
- name: Install dependencies | ||
run: npm install | ||
|
||
- name: Build React App | ||
- name: Build HTML files from JSX | ||
run: | | ||
cd src/components | ||
npm run build | ||
mv build/* ../.. | ||
npx babel --out-dir build src/components --extensions .jsx | ||
env: | ||
CI: true | ||
|
||
- name: Deploy to GitHub Pages | ||
run: | | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "Your Name" | ||
git checkout --orphan gh-pages | ||
git --work-tree build add --all | ||
git --work-tree build commit -m "Deploy to GitHub Pages" | ||
git rm -rf . | ||
mv build/* . | ||
git add . | ||
git commit -m "Deploy to GitHub Pages" | ||
git push origin HEAD:gh-pages --force | ||
env: | ||
CI: true |