forked from tinkoff-ai/etna
-
Notifications
You must be signed in to change notification settings - Fork 6
53 lines (50 loc) · 1.6 KB
/
docs-latest.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
name: Build docs from trunk
on:
push:
branches:
- master
# we set this not to stuck in a state after clearing s3 folder and before filling it with new files
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false
jobs:
build-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.10"
- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v2
with:
path: .venv
key: venv-${{ runner.os }}-docs-${{ hashFiles('**/poetry.lock') }}
- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: |
poetry install -E "all docs" -vv
- name: Install apt docs dependencies
run: |
sudo apt install pandoc
sudo apt install s3cmd
- name: Build docs
run: |
cd docs
poetry run make build-docs
mv build/html/ ../site
env:
CI_COMMIT_SHORT_SHA: ${{ github.sha }}
WORKFLOW_NAME: ${{ github.workflow }}
- name: Deploy to s3
run: |
echo "${{ secrets.DOCS_S3CMD_CONFIG }}" > .s3cfg
s3cmd -c .s3cfg rm -r "s3://docs.etna.ai/latest/"
s3cmd -c .s3cfg put --recursive --guess-mime-type --no-mime-magic ./site/ "s3://docs.etna.ai/latest/"