Skip to content

Commit e3e8ab3

Browse files
authored
Avoid building documentation twice. (#25)
* Better GitHub Actions to avoid building documentation twice. * Temporary change to debug GitHub Actions. * Use GitHub Actions only for updating the website.
1 parent 2eb725b commit e3e8ab3

File tree

1 file changed

+7
-12
lines changed

1 file changed

+7
-12
lines changed

.github/workflows/ocaml.yml

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,22 @@
1-
name: Build and test
1+
name: Upload the website
22
on:
33
push:
44
branches:
55
- master
66
pull_request:
7+
branches:
8+
- doc*
79
jobs:
810
run:
9-
env:
10-
with_doc: ${{ github.ref == 'refs/heads/master' || startsWith (github.ref, 'refs/heads/doc') }}
1111
runs-on: ubuntu-latest
1212
steps:
1313
- uses: actions/checkout@v2
1414
- uses: avsm/setup-ocaml@v1
1515
with:
1616
ocaml-version: '4.10.0'
17-
- if: ${{ ! env.with_doc }}
18-
run: opam pin . --with-test -y
19-
- if: env.with_doc
20-
run: |
21-
opam pin . --with-test --with-doc -y
22-
opam exec -- dune build @doc
23-
- if: env.with_doc
24-
uses: peaceiris/actions-gh-pages@v3
17+
- run: opam pin . --with-test --with-doc -y
18+
- run: echo '::set-env name=BUILD_ROOT::'`opam config var yuujinchou:build`
19+
- uses: peaceiris/actions-gh-pages@v3
2520
with:
2621
github_token: ${{ secrets.GITHUB_TOKEN }}
27-
publish_dir: ./_build/default/_doc/_html/
22+
publish_dir: ${{ format('{0}/_build/default/_doc/_html/', env.BUILD_ROOT) }}

0 commit comments

Comments
 (0)