-
Notifications
You must be signed in to change notification settings - Fork 6
129 lines (109 loc) · 3.59 KB
/
ci.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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
name: Juvix Docs CI
"on":
workflow_dispatch:
inputs:
build-type:
type: choice
description: "Docs build type"
default: "dev"
options:
- "dev"
- "latest"
skip:
description: Skipped build tasks (comma-separated) e.g., check-format-juvix-files, typecheck-juvix-files
default: ""
required: false
push:
branches:
- main
pull_request:
branches:
- main
types:
- opened
- reopened
- synchronize
- ready_for_review
concurrency:
group: "${{ github.workflow }}-${{ github.head_ref || github.run_id }}"
cancel-in-progress: true
env:
GIT_COMMITTER_NAME: juvix-docs-ci
GIT_COMMITTER_EMAIL: [email protected]
SKIP: ${{ github.event.inputs.skip }}
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout our repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install the latest Juvix compiler (for latest build-type)
uses: jaxxstorm/[email protected]
if: github.event_name == 'workflow_dispatch' && github.event.inputs.build-type == 'latest'
with:
repo: anoma/juvix
tag: latest
chmod: 0755
- name: See the dev version in the documentation
id: juvix-version
run: |
echo "number=$(cat VERSION)" >> "$GITHUB_OUTPUT"
- name: Install the corresponding Juvix compiler
uses: jaxxstorm/[email protected]
if: github.event_name != 'workflow_dispatch' || ( github.event_name != 'workflow_dispatch' || github.event.inputs.build-type == 'dev')
with:
repo: anoma/juvix
tag: v${{ steps.juvix-version.outputs.number }}
- name: See the exact version of the Juvix compiler installed
run: |
juvix --version
- uses: actions/cache@v3
with:
key: ${{ github.ref }}
path: .cache
- uses: actions/setup-python@v4
with:
python-version: "3.11.1"
check-latest: true
cache: "pip"
- uses: pre-commit/[email protected]
- name: Generate HTML files from examples
run: |
make html-examples
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install --user -r requirements.txt
- name: Build prerequisites
run: |
make pre-build
- name: Test building without material-insiders
run: |
MKDOCSCONFIG=mkdocs.yml make docs
- name: Setup Git
run: |
git config --global user.name "${GIT_COMMITTER_NAME}"
git config --global user.email "${GIT_COMMITTER_EMAIL}"
- name: Install material-insiders
if: >-
github.ref == 'refs/heads/main'
run: |
pip install --user -r insiders.requirements.txt
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
- name: Deploy documentation via GitHub (for releases)
if: >-
github.ref == 'refs/heads/main' && github.event_name == 'workflow_dispatch'
run: |
MKDOCSCONFIG=mkdocs.insiders.yml make ${{ github.event.inputs.build-type }}
env:
RUN_GITHUB_ACTION: ${{ secrets.RUN_GITHUB_ACTION }}
- name: By default, deploy DEV documentation via pushes to main
if: >-
github.ref == 'refs/heads/main' && github.event_name != 'workflow_dispatch'
run: |
MKDOCSCONFIG=mkdocs.insiders.yml make dev
env:
RUN_GITHUB_ACTION: ${{ secrets.RUN_GITHUB_ACTION }}