Skip to content

Commit 08c8b00

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

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

.github/workflows/deploy.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
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: (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
22+
23+
- uses: actions/upload-artifact@v4
24+
with:
25+
name: github-pages
26+
path: github-pages.tar.gz
27+
28+
# Deploy job
29+
deploy:
30+
needs: build
31+
32+
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
33+
permissions:
34+
pages: write # to deploy to Pages
35+
id-token: write # to verify the deployment originates from an appropriate source
36+
37+
# Deploy to the github-pages environment
38+
environment:
39+
name: github-pages
40+
url: ${{ steps.deployment.outputs.page_url }}
41+
42+
# Specify runner + deployment step
43+
runs-on: ubuntu-latest
44+
steps:
45+
- name: Deploy to GitHub Pages
46+
id: deployment
47+
uses: actions/deploy-pages@v4 # or specific "vX.X.X" version tag for this action

0 commit comments

Comments
 (0)