Skip to content

Commit 3714e4c

Browse files
committed
Deploy on Github Pages
1 parent 215b998 commit 3714e4c

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

.github/workflows/deploy.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
jobs:
2+
# Build job
3+
build:
4+
steps:
5+
- name: Checkout tree
6+
uses: actions/checkout@v4
7+
8+
- name: Set-up OCaml
9+
uses: ocaml/setup-ocaml@v3
10+
with:
11+
ocaml-compiler: 5.3
12+
13+
- run:|
14+
opam pin add -n git@github.com:dbuenzli/brr.git
15+
opam install brr lwt yojson wasm_of_ocaml-compiler
16+
17+
- name: Build
18+
run: cd src/web && dune build @all
19+
20+
- name: Build archive
21+
run:|
22+
(cd _build/default/src/web && tar zcf - data icon*.png index.html manifest.json viewer.bc.wasm.* service_worker/service_worker.bc.js) > github-pages.tar.gz
23+
24+
- uses: actions/upload-artifact@v4
25+
with:
26+
name: github-pages
27+
path: github-pages.tar.gz
28+
29+
# Deploy job
30+
deploy:
31+
needs: build
32+
33+
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
34+
permissions:
35+
pages: write # to deploy to Pages
36+
id-token: write # to verify the deployment originates from an appropriate source
37+
38+
# Deploy to the github-pages environment
39+
environment:
40+
name: github-pages
41+
url: ${{ steps.deployment.outputs.page_url }}
42+
43+
# Specify runner + deployment step
44+
runs-on: ubuntu-latest
45+
steps:
46+
- name: Deploy to GitHub Pages
47+
id: deployment
48+
uses: actions/deploy-pages@v4 # or specific "vX.X.X" version tag for this action

0 commit comments

Comments
 (0)