-
Notifications
You must be signed in to change notification settings - Fork 9
97 lines (81 loc) · 3.04 KB
/
gen-doc-and-deploy-to-github-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
name: gen-doc-and-deploy-to-github-pages
on:
push:
branches: [main]
workflow_dispatch:
branches: [main]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.10.7]
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install System Dependencies
run: |
sudo apt-get install cmake protobuf-compiler wget curl redis-server postgresql nginx
- name: Run System Services
run: |
sudo systemctl enable postgresql
sudo systemctl start postgresql
- name: Create Database Tables
run: |
sudo -u postgres psql -c "ALTER USER postgres WITH PASSWORD 'opentera';"
sudo -u postgres psql -c "create database opentera;"
sudo -u postgres psql -c "create user TeraAgent with encrypted password 'tera';"
sudo -u postgres psql -c "grant all privileges on database opentera to TeraAgent;"
sudo -u postgres psql -c "ALTER USER TeraAgent WITH PASSWORD 'tera';"
sudo -u postgres psql -c "create database openteralogs;"
sudo -u postgres psql -c "grant all privileges on database openteralogs to TeraAgent;"
sudo -u postgres psql -c "create database openterafiles;"
sudo -u postgres psql -c "grant all privileges on database openterafiles to TeraAgent;"
sudo -u postgres psql -c "\l"
- name: Install Miniconda3
run: |
echo $HOME
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
bash ./Miniconda3-latest-Linux-x86_64.sh -b -p $HOME/miniconda3
- name: Run CMake and build
working-directory: teraserver
run: |
cmake .
make python-all
echo "OPENTERA_PYTHON=$(echo $PWD/python/env/python-3.10/bin/python)" >> $GITHUB_ENV
echo "PYTHONPATH=$(echo $PWD/python)" >> $GITHUB_ENV
- name: Generate Self Signed TLS Certificates
working-directory: teraserver/python
run: |
$OPENTERA_PYTHON CreateCertificates.py
- name: Run NGINX Reverse Proxy
working-directory: teraserver/python/config
run: |
mkdir logs
./start_nginx.sh
- name: Start TeraServer With Tests Enabled
working-directory: teraserver/python
run: |
$OPENTERA_PYTHON TeraServer.py --enable_tests=1 &
sleep 10
- name: Update API json documentation
working-directory: docs/services/teraserver/api
run: |
curl -O --insecure https://localhost:40075/api/swagger.json
- name: Generate base documentation
working-directory: docs
run: |
pip install -r requirements.txt
make html
touch _build/html/.nojekyll
- name: Deploy to GitHub Pages
uses: JamesIves/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: gh-pages
folder: docs/_build/html