-
Notifications
You must be signed in to change notification settings - Fork 1
74 lines (64 loc) · 2.05 KB
/
build_docs.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
name: Build doc
on:
push:
pull_request:
jobs:
build:
name: Build docs
runs-on: ubuntu-latest
# Avoid running twice the action if it's triggered by a push on a PR from a branch on the repo.
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
container:
image: coqorg/coq:8.19
# This is a workaround a "bug" on the checkout action,
# see https://github.com/actions/checkout/issues/956
options: --user root
steps:
- uses: actions/checkout@master
- name: "Run coq-community/docker-coq-action@v1 with debian:10"
uses: coq-community/docker-coq-action@v1
with:
# Explanation for the permission issue:
# https://github.com/coq-community/docker-coq-action#permissions
before_script: |
startGroup "Workaround permission issue"
sudo chown -R coq:coq . # <--
endGroup
script: |
startGroup "Build project"
opam update -y
./install.sh -y
make -j 4
make -j 4 doc
endGroup
uninstall: |
startGroup "Clean project"
make clean
endGroup
- name: Upload docs
uses: actions/upload-artifact@master
with:
name: docs-artifact
path: docs
- name: Revert permissions
# to avoid a warning at cleanup time
if: ${{ always() }}
run: sudo chown -R 1001:116 . # <--
deploy:
runs-on: ubuntu-latest
needs: build
if: github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@master
- uses: actions/download-artifact@master
with:
name: docs-artifact
path: docs
- name: Deploy
uses: peaceiris/actions-gh-pages@v3.8.0
with:
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
publish_dir: docs
allow_empty_commit: true
force_orphan: true
enable_jekyll: true