Merge pull request #1798 from SEKOIA-IO/update-automation-library-doc… #1520
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: Upload public website to OVH | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build_and_upload_website: | |
name: Build and upload public version of the website | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout main | |
uses: actions/checkout@v4 | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
id: setup-python | |
with: | |
python-version: '3.11' | |
- name: Make destination directory for compiled CSS | |
run: mkdir -vp docs/stylesheets/ | |
- name: Compile CSS from SCSS files | |
uses: gha-utilities/[email protected] | |
with: | |
source: src/sekoiaio.scss | |
destination: docs/stylesheets/sekoiaio.css | |
- name: Install Poetry | |
run: | | |
pip install poetry | |
poetry config virtualenvs.in-project true | |
- name: Load cached venv | |
id: cached-poetry-dependencies | |
uses: actions/[email protected] | |
with: | |
path: .venv | |
key: poetry-${{ runner.os }}-python${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('poetry.lock') }} | |
restore-keys: | | |
poetry-${{ runner.os }}-python${{ steps.setup-python.outputs.python-version }} | |
- name: Install dependencies | |
run: | | |
poetry install | |
- name: Build site | |
run: | | |
poetry run python -m mkdocs build | |
- name: Install Swift | |
run: | | |
pip install python-swiftclient==4.3.0 python-keystoneclient==5.1.0 | |
- name: Delete old content on remote storage | |
run: | | |
swift list sekoiaio-public-documentation -j | jq -r ".[].name" | while read remote_file; do | |
if [ ! -f "site/${remote_file}" ]; then | |
swift delete sekoiaio-public-documentation "$remote_file" --object-threads 5 | |
fi | |
done | |
env: | |
OS_AUTH_URL: "https://auth.cloud.ovh.net/v3/" | |
OS_IDENTITY_API_VERSION: 3 | |
OS_TENANT_ID: ${{ secrets.SITE_OS_TENANT_ID }} | |
OS_TENANT_NAME: ${{ secrets.SITE_OS_TENANT_NAME }} | |
OS_USERNAME: ${{ secrets.SITE_OS_USERNAME }} | |
OS_PASSWORD: ${{ secrets.SITE_OS_PASSWORD }} | |
OS_REGION_NAME: "GRA" | |
- name: OVH Object Storage | |
run: | | |
swift upload sekoiaio-public-documentation site --object-name / --object-threads 5 | |
env: | |
OS_AUTH_URL: "https://auth.cloud.ovh.net/v3/" | |
OS_IDENTITY_API_VERSION: 3 | |
OS_TENANT_ID: ${{ secrets.SITE_OS_TENANT_ID }} | |
OS_TENANT_NAME: ${{ secrets.SITE_OS_TENANT_NAME }} | |
OS_USERNAME: ${{ secrets.SITE_OS_USERNAME }} | |
OS_PASSWORD: ${{ secrets.SITE_OS_PASSWORD }} | |
OS_REGION_NAME: "GRA" |