-
Notifications
You must be signed in to change notification settings - Fork 25
148 lines (145 loc) · 4.86 KB
/
pages.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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
# Simple workflow for deploying static content to GitHub Pages
name: Deploy static content to Pages
env:
Python_Version: '3.10'
on:
release:
types: [published]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
build_python_docs:
name: Build Python Documentation
runs-on: ubuntu-latest
permissions:
contents: write
concurrency:
group: Deploy-Static-Content-Pages
cancel-in-progress: false
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
- uses: actions/setup-python@v4
name: Install Python
with:
python-version: ${{env.Python_Version}}
- uses: actions/setup-node@v3
with:
node-version: latest
- name: Python Cache Key
shell: bash
run: |
echo $(which python) > /tmp/python_version.txt
- name: Get pip cache dir
shell: bash
id: pip-cache
run: |
echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT
- name: Pip-Tools
shell: bash
run: |
python -m pip install -U pip
python -m pip install pip-tools
pip-compile setup.cfg
pip-compile build-requirements.in
pip-compile doc-requirements.in
- name: pip cache
uses: actions/cache@v3
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pages-pip-${{ hashFiles('/tmp/python_version.txt') }}-${{ hashFiles('requirements.txt') }}-${{ hashFiles('build-requirements.txt') }}-${{ hashFiles('doc-requirements.txt') }}
restore-keys: |
${{ runner.os }}-pages-pip-${{ hashFiles('/tmp/python_version.txt') }}-${{ hashFiles('requirements.txt') }}-${{ hashFiles('build-requirements.txt') }}-${{ hashFiles('doc-requirements.txt') }}
${{ runner.os }}-pages-pip-${{ hashFiles('/tmp/python_version.txt') }}-${{ hashFiles('requirements.txt') }}-${{ hashFiles('build-requirements.txt') }}
${{ runner.os }}-pip-${{ hashFiles('/tmp/python_version.txt') }}-${{ hashFiles('requirements.txt') }}
${{ runner.os }}-pip-${{ hashFiles('/tmp/python_version.txt') }}
- name: Update
run: |
pip install --upgrade pip wheel setuptools build cmake ninja
- name: Install Dependencies
shell: bash
run: |
set -eux
pip-sync requirements.txt build-requirements.txt doc-requirements.txt
pip install --upgrade pip wheel setuptools build cmake ninja typing-extensions
sudo apt-get install -y libeigen3-dev libopenblas-dev
python -m pip install -vvv .
- name: Install Dep
run: |
sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get install -y dvisvgm graphviz mscgen dia pdf2svg astyle doxygen doxygen-doxyparse fonts-liberation python3-breathe
npm install -g katex marked
- name: Prepare
shell: bash
run: |
set -eux
mkdir build
- name: CMake Configure
shell: bash
run: >
cmake
-DBUILD_DOCS=ON
-G Ninja
-S .
-B build
- name: CMake Build
shell: bash
run: >
cmake
--build build
--parallel
--verbose
--target cxxjij_header_only_docs
- name: Jupyter Book
run: |
jupyter-book build docs --all
- name: du -a
shell: bash
if: always()
run: |
du -a
- name: Prepare tag
id: prepare_tag
if: startsWith(github.ref, 'refs/tags/')
run: |
TAG_NAME="${GITHUB_REF##refs/tags/}"
echo "tag_name=${TAG_NAME}" >> $GITHUB_OUTPUT
echo "deploy_tag_name=deploy-${TAG_NAME}" >> $GITHUB_OUTPUT
- uses: actions/upload-artifact@v3
with:
name: HTML
path: ./docs/_build/html
retention-days: 30
# Single deploy job since we're just deploying
deploy:
needs: build_python_docs
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
# Allow one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: false
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v3
with:
name: HTML
path: ./html
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
# Upload entire repository
path: './html'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2