Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit f6d1e34

Browse files
committedNov 12, 2024·
🐎 ci: test deploy to pages
1 parent 9d6fc56 commit f6d1e34

File tree

3 files changed

+92
-27
lines changed

3 files changed

+92
-27
lines changed
 

‎.github/workflows/ci.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: test and deploy
2+
3+
on:
4+
push:
5+
branches: ["main"]
6+
pull_request:
7+
branches: ["main"]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout repository
15+
uses: actions/checkout@v4
16+
17+
- name: Setup node
18+
uses: actions/setup-node@v4
19+
with:
20+
node-version: 22
21+
22+
- name: Install dependencies
23+
run: npm install
24+
25+
- name: Run unit tests
26+
run: npm run test
27+
28+
- name: Build
29+
run: |
30+
npm run build
31+
rm -rf dist/*.map
32+
33+
deploy:
34+
needs: test
35+
runs-on: ubuntu-latest
36+
37+
steps:
38+
- name: Checkout repository
39+
uses: actions/checkout@v4
40+
41+
- name: Setup node
42+
uses: actions/setup-node@v4
43+
with:
44+
node-version: 22
45+
46+
- name: Install dependencies
47+
run: npm install
48+
49+
- name: Build
50+
run: |
51+
npm run build

‎.github/workflows/deploy-to-pages.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Deploy chili3d to Pages
2+
3+
on:
4+
push:
5+
branches: [ "test" ]
6+
pull_request:
7+
branches: [ "test" ]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- name: Setup node
17+
uses: actions/setup-node@v4
18+
with:
19+
node-version: 22
20+
21+
- name: Build
22+
run: |
23+
npm install
24+
npm run build
25+
rm -rf dist/*.map
26+
27+
- name: Upload GitHub Pages artifact
28+
uses: actions/upload-pages-artifact@v3.0.1
29+
with:
30+
path: ./dist
31+
32+
deploy:
33+
environment:
34+
name: github-pages
35+
url: ${{ steps.deployment.outputs.page_url }}
36+
runs-on: ubuntu-latest
37+
needs: build
38+
steps:
39+
- name: Deploy to GitHub Pages
40+
id: deployment
41+
uses: actions/deploy-pages@v4

‎.github/workflows/main.yml

Lines changed: 0 additions & 27 deletions
This file was deleted.

0 commit comments

Comments
 (0)
Please sign in to comment.