Skip to content

Commit e49a5ab

Browse files
committed
Add Github Actions
1 parent 24e00f4 commit e49a5ab

3 files changed

Lines changed: 58 additions & 1 deletion

File tree

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: build and publish
2+
3+
on:
4+
push:
5+
branches: [myget]
6+
pull_request:
7+
branches: [myget]
8+
workflow_dispatch:
9+
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v6
17+
with:
18+
fetch-depth: 0
19+
20+
- name: Use Node.js
21+
uses: actions/setup-node@v6
22+
with:
23+
# Examples: 20, 18.19, >=16.20.2, lts/Iron, lts/Hydrogen, *, latest, current, node
24+
# Ref: https://github.com/actions/setup-node#supported-version-syntax
25+
node-version: latest
26+
27+
- name: Install Dependencies
28+
run: npm install
29+
30+
- name: Build
31+
run: npm run build-vite
32+
33+
- name: Upload Pages artifact
34+
uses: actions/upload-pages-artifact@v4
35+
with:
36+
path: dev/dist
37+
38+
deploy:
39+
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
40+
needs: build
41+
42+
permissions:
43+
pages: write
44+
id-token: write
45+
46+
environment:
47+
name: github-pages
48+
url: ${{ steps.deployment.outputs.page_url }}
49+
50+
runs-on: ubuntu-latest
51+
52+
steps:
53+
- name: Deploy to GitHub Pages
54+
id: deployment
55+
uses: actions/deploy-pages@v4

.npmignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
example.png
1+
.github/
2+
dev/

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
"dev-vite": "vite ./dev",
2222
"dev-cm": "node ./dev/watch.cjs src/index.ts",
2323
"build": "cm-buildhelper src/index.ts",
24+
"build-vite": "npm run build && vite build ./dev",
2425
"test": "cm-runtests",
2526
"publish": "npm run build && npm publish"
2627
},

0 commit comments

Comments
 (0)