Skip to content

Commit 42ad587

Browse files
committed
chore: github page deployment automation
1 parent 8e2e91c commit 42ad587

File tree

2 files changed

+48
-0
lines changed

2 files changed

+48
-0
lines changed

.github/workflows/github-page.yml

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Github Page
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
github-page:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v3
15+
16+
- name: Setup Node.js environment
17+
uses: actions/setup-node@v3
18+
with:
19+
node-version: 18
20+
21+
- name: Install dependencies
22+
env :
23+
CI: true
24+
run: |
25+
npm pkg delete scripts.prepare
26+
npm ci
27+
28+
- name: Run build Github Page
29+
run: |
30+
npm run github
31+
32+
- name: Deploy GitHub Page
33+
uses: JamesIves/github-pages-deploy-action@releases/v3
34+
with:
35+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
36+
BRANCH: gh-pages
37+
FOLDER: dist

package.json

+11
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,23 @@
2828
"cassettator-markers-css": {
2929
"source": "src/markers/css/cassettator-markers.css",
3030
"optimize": true
31+
},
32+
"github": {
33+
"publicUrl": "./",
34+
"source": [
35+
"src/markers/index.html"
36+
],
37+
"distDir": "./dist",
38+
"isLibrary": false,
39+
"outputFormat": "esmodule",
40+
"optimize": true
3141
}
3242
},
3343
"scripts": {
3444
"build": "npm run build:cassettator && npm run build:css",
3545
"build:cassettator": "rollup -c rollup.config.mjs",
3646
"build:css": "parcel build --target cassettator-markers-css",
47+
"github": "parcel build --target github",
3748
"start": "parcel -p 6969 src/**/*.html"
3849
},
3950
"files": [

0 commit comments

Comments
 (0)