Skip to content

Commit 8ac11e1

Browse files
authored
Merge pull request #55 from OSSPhilippines/warengonzaga/add-gh-pages
Add GitHub Pages deployment
2 parents 42782a5 + 4049c2b commit 8ac11e1

File tree

2 files changed

+36
-2
lines changed

2 files changed

+36
-2
lines changed

.github/workflows/gh-pages.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Deploy to GitHub Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout repository
14+
uses: actions/checkout@v2
15+
16+
- name: Setup Node.js
17+
uses: actions/setup-node@v2
18+
with:
19+
node-version: '14'
20+
21+
- name: Install dependencies
22+
run: npm install
23+
24+
- name: Build project
25+
run: npm run build
26+
27+
- name: Deploy to GitHub Pages
28+
run: npm run deploy
29+
env:
30+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

package.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"name": "philippine-map-app",
33
"version": "0.2.1",
44
"private": true,
5+
"homepage": "https://ossphilippines.github.io/philippines-travel-level-map",
56
"dependencies": {
67
"@testing-library/jest-dom": "^5.16.5",
78
"@testing-library/react": "^13.4.0",
@@ -18,7 +19,9 @@
1819
"build": "react-scripts build",
1920
"test": "react-scripts test",
2021
"eject": "react-scripts eject",
21-
"lint": "eslint . --ext .js,.jsx --fix"
22+
"lint": "eslint . --ext .js,.jsx --fix",
23+
"predeploy": "npm run build",
24+
"deploy": "gh-pages -d build"
2225
},
2326
"eslintConfig": {
2427
"extends": [
@@ -40,6 +43,7 @@
4043
},
4144
"devDependencies": {
4245
"eslint": "^8.39.0",
43-
"eslint-plugin-react": "^7.32.2"
46+
"eslint-plugin-react": "^7.32.2",
47+
"gh-pages": "^5.0.0"
4448
}
4549
}

0 commit comments

Comments
 (0)