Skip to content

Commit 21f3c6d

Browse files
committed
ci: deploy to GitHub Pages
1 parent 55dc0ca commit 21f3c6d

File tree

5 files changed

+53
-3
lines changed

5 files changed

+53
-3
lines changed

.github/workflows/deploy.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Deploy to GitHub Pages
2+
3+
on:
4+
push:
5+
6+
permissions:
7+
contents: read
8+
pages: write
9+
id-token: write
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
- uses: actions/setup-node@v4
17+
with:
18+
node-version: lts/*
19+
- uses: pnpm/action-setup@v4
20+
with:
21+
version: 10
22+
- run: pnpm install
23+
- run: pnpm build
24+
- uses: actions/upload-pages-artifact@v3
25+
with:
26+
path: dist
27+
28+
deploy:
29+
needs: build
30+
runs-on: ubuntu-latest
31+
environment:
32+
name: github-pages
33+
url: ${{ steps.deployment.outputs.page_url }}
34+
steps:
35+
- name: Deploy to GitHub Pages
36+
id: deployment
37+
uses: actions/deploy-pages@v4

demos/astro.config.mjs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { defineConfig } from "astro/config";
2+
3+
// https://astro.build/config
4+
export default defineConfig({
5+
site: "https://jsulpis.github.io",
6+
base: "/talk-webgpu",
7+
});

package.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"scripts": {
3+
"prebuild": "rm -rf dist",
4+
"build": "pnpm -r build && mv demos/dist dist && mv slides/dist/* dist",
5+
"dev": "pnpm -r dev"
6+
}
7+
}

slides/.env.production

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
# TODO: deploy to GitHub Pages and update this URL
2-
VITE_DEMOS_BASE_URL=http://localhost:4321
1+
VITE_DEMOS_BASE_URL=http://jsulpis.github.io/talk-webgpu

slides/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"private": true,
44
"type": "module",
55
"scripts": {
6-
"build": "slidev build",
6+
"build": "slidev build --base /talk-webgpu/",
77
"dev": "slidev",
88
"export": "slidev export"
99
},

0 commit comments

Comments
 (0)