Build and Deploy #207
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Deploy | |
on: | |
push: | |
branches: | |
- 'master' | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install dependencies | |
run: | | |
python -m venv .venv | |
source .venv/bin/activate | |
python -m pip install --upgrade pip setuptools wheel | |
pip install --prefer-binary -U -r requirements.txt | |
- name: Build driver dependencies | |
run: | | |
source .venv/bin/activate | |
cd extensions-doc-builder | |
mkdir deps | |
echo "Install CTK and minor dependencies" | |
pip install --prefer-binary --pre -U chaostoolkit-lib chaostoolkit | |
pip install --prefer-binary httplib2 uritemplate pytzdata | |
echo "install all the dependencies for our drivers" | |
pip install --prefer-binary -U -r requirements-toolkit.txt | |
echo "download all the extensions package to get access to their README and source" | |
pip download \ | |
--no-deps \ | |
--no-cache-dir \ | |
--dest deps \ | |
--no-binary=chaostoolkit-aws,chaostoolkit-azure,chaostoolkit-cloud-foundry,chaostoolkit-google-cloud-platform,chaostoolkit-humio,chaostoolkit-kubernetes,chaostoolkit-prometheus,chaostoolkit-spring,chaostoolkit-toxiproxy,chaostoolkit-opentracing,chaostoolkit-service-fabric,chaostoolkit-istio,chaostoolkit-wiremock,chaostoolkit-gandi,chaostoolkit-dynatrace,chaostoolkit-k6,chaostoolkit-ansible,chaostoolkit-reliably,chaostoolkit-addons,chaostoolkit-grafana,chaostoolkit-slack,chaostoolkit-datadog,chaostoolkit-terraform,chaostoolkit-honeycomb \ | |
-r requirements-toolkit.txt | |
echo "Installing each extension individually" | |
cd deps | |
for archive in *.tar.gz; | |
do | |
tar zxvf "$archive" | |
dirname=$(basename $archive .tar.gz) | |
echo "Installing ${dirname}" | |
cd $dirname | |
pip install -e . | |
cd .. | |
done | |
cd ../.. | |
- name: Build driver pages | |
run: | | |
source .venv/bin/activate | |
cd extensions-doc-builder | |
if python ext2md.py; then | |
echo "Extension documentation built" | |
fi | |
cd .. | |
- name: Build documentation | |
run: | | |
source .venv/bin/activate | |
mkdir /tmp/site | |
cd /tmp/site | |
git clone https://$GH_USER_NAME:[email protected]/chaostoolkit/chaostoolkit-documentation.git . | |
git checkout gh-pages | |
cd - | |
git submodule update --init --remote | |
mkdocs build --strict -d /tmp/site | |
cp robots.txt /tmp/site/robots.txt | |
cd .. | |
- name: Deploy 🚀 | |
uses: JamesIves/[email protected] | |
with: | |
branch: gh-pages | |
folder: /tmp/site |