Skip to content

Commit f3c694d

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

File tree

1 file changed

+55
-0
lines changed

1 file changed

+55
-0
lines changed

.github/workflows/deploy.yml

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

0 commit comments

Comments
 (0)