-
Notifications
You must be signed in to change notification settings - Fork 0
84 lines (69 loc) · 1.92 KB
/
workflow.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
name: CI
on:
push:
branches:
- 'main'
pull_request:
types: [opened, synchronize, reopened, labeled, unlabeled]
jobs:
build:
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macos-latest
ocaml-compiler:
- "5.1"
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install OCaml
uses: ocaml/setup-ocaml@v2
with:
ocaml-compiler: ${{ matrix.ocaml-compiler }}
- name: Install dependencies
run: opam install . --deps-only --with-test
- name: Build Lice libraries and executables
run: opam exec -- dune build
- name: Run tests
run: opam exec -- dune runtest
- name: Upload playground.bc.js
uses: actions/upload-artifact@v4
with:
name: playground
path: _build/default/doc/ocaml/playground.bc.js
lint-fmt:
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout tree
uses: actions/checkout@v4
- name: Install OCaml
uses: ocaml/setup-ocaml@v2
with:
ocaml-compiler: "5.1"
dune-cache: true
- uses: ocaml/setup-ocaml/lint-fmt@v2
deploy-site:
needs: [build, lint-fmt]
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v4
- name: Download playground.bc.js
uses: actions/download-artifact@v2
with:
name: playground
path: doc/assets/playground.bc.js
- name: Deploy to VPS Server
uses: easingthemes/ssh-deploy@main
with:
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
ARGS: "-rlgoDzvc -i"
SOURCE: "/doc/"
REMOTE_HOST: ${{ secrets.HOST }}
REMOTE_USER: ${{ secrets.USERNAME }}
TARGET: ${{ secrets.PATH }}
EXCLUDE: "/ocaml/, *.md"