Skip to content

Commit 37081df

Browse files
author
Ryan Miville
committed
gh pages workflow
1 parent 5cdca12 commit 37081df

File tree

2 files changed

+50
-3
lines changed

2 files changed

+50
-3
lines changed

.github/workflows/pages.yml

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: deploy to GitHub Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
deploy:
10+
name: Deploy to GitHub Pages
11+
runs-on: ubuntu-latest
12+
permissions:
13+
contents: read
14+
deployments: write
15+
pages: write
16+
id-token: write
17+
environment:
18+
name: github-pages
19+
steps:
20+
- name: Checkout repo
21+
uses: actions/checkout@v4
22+
- name: Set up Gleam
23+
uses: erlef/setup-beam@v1
24+
with:
25+
otp-version: "27.0"
26+
gleam-version: "1.5.1"
27+
rebar3-version: "3"
28+
- name: Install dependencies
29+
run: gleam deps download
30+
- name: Build app
31+
run: gleam run -m lustre/dev build app --minify
32+
- name: Copy output to dist
33+
run: |
34+
mkdir -p dist
35+
cp index.html dist/index.html
36+
cp -r priv dist/priv
37+
- name: Update path in index.html to use minified app
38+
run: sed -i 's|priv/static/todomvc.mjs|/priv/static/todomvc.min.mjs|' dist/index.html
39+
- name: Setup Pages
40+
uses: actions/configure-pages@v5
41+
- name: Upload artifact
42+
uses: actions/upload-pages-artifact@v3
43+
with:
44+
path: "dist"
45+
- name: Deploy to GitHub Pages
46+
id: deployment
47+
uses: actions/deploy-pages@v4

index.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66

77
<title>TodoMVC: Lustre</title>
88

9-
<link rel="stylesheet" href="/priv/static/base.css" />
10-
<link rel="stylesheet" href="/priv/static/index.css" />
11-
<script type="module" src="/priv/static/todomvc.mjs"></script>
9+
<link rel="stylesheet" href="./priv/static/base.css" />
10+
<link rel="stylesheet" href="./priv/static/index.css" />
11+
<script type="module" src="./priv/static/todomvc.mjs"></script>
1212
</head>
1313

1414
<body>

0 commit comments

Comments
 (0)