Skip to content

Commit ae3f1f6

Browse files
committed
workflows
1 parent c136160 commit ae3f1f6

File tree

3 files changed

+48
-1
lines changed

3 files changed

+48
-1
lines changed

.github/workflows/deploy.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Deploy to GitHub Pages
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
workflow_dispatch:
7+
8+
jobs:
9+
build-and-deploy:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout repository
14+
uses: actions/checkout@v3
15+
16+
- name: Set up Node.js
17+
uses: actions/setup-node@v3
18+
with:
19+
node-version: 18
20+
cache: 'npm'
21+
22+
- name: Install dependencies
23+
run: npm ci
24+
25+
- name: Build
26+
run: npm run build
27+
28+
- name: Deploy to GitHub Pages
29+
uses: JamesIves/github-pages-deploy-action@v4
30+
with:
31+
folder: build # The folder the action should deploy
32+
branch: gh-pages # The branch the action should deploy to

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,20 @@ This section has moved here: [https://facebook.github.io/create-react-app/docs/a
6565

6666
This section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)
6767

68+
### GitHub Pages Deployment
69+
70+
This project is configured to deploy automatically to GitHub Pages using GitHub Actions.
71+
72+
When you push to the `main` branch, the GitHub Actions workflow will:
73+
1. Build the application
74+
2. Deploy it to the `gh-pages` branch
75+
3. Make it available at the URL specified in the `homepage` field in `package.json`
76+
77+
To set up for your repository:
78+
1. Make sure to update the `homepage` field in `package.json` with your GitHub username and repository name
79+
2. Enable GitHub Pages in your repository settings, set to deploy from the `gh-pages` branch
80+
3. Push your code to the `main` branch to trigger the deployment
81+
6882
### `npm run build` fails to minify
6983

7084
This section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
{
22
"name": "horizon-demo",
33
"version": "0.1.0",
4-
"private": true,
4+
"private": false,
5+
"homepage": "https://generalusermodels.github.io/",
56
"dependencies": {
67
"@testing-library/dom": "^10.4.0",
78
"@testing-library/jest-dom": "^6.6.3",

0 commit comments

Comments
 (0)