-
Notifications
You must be signed in to change notification settings - Fork 57
84 lines (71 loc) · 2.66 KB
/
deploy-public-website.yaml
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
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 --strict
- 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"