Skip to content

Update content in docs #105

Update content in docs

Update content in docs #105

Workflow file for this run

name: BuildDocs
on:
push:
branches:
- "main"
- "dev_docs"
paths:
- ".github/workflows/build_docs.yml"
- "celery_task/**"
- "docs_dev/**"
- "main.py"
- "models/**"
- "module/**"
- "structs/**"
- "view/**"
workflow_dispatch:
jobs:
build:
strategy:
matrix:
os: ["ubuntu-20.04"]
python-version: ["3.11"]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Update libs
run: sudo apt-get update
- name: Install memcached libs
run: sudo apt-get install ca-certificates libmemcached-tools
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Cache Poetry venv
uses: actions/cache@v3
with:
path: ./.venv
key: poetry-venv-${{ matrix.python-version }}${{ hashFiles('**/poetry.lock') }}
- name: Cache Poetry local
uses: actions/cache@v3
with:
path: ~/.local/share/pypoetry
key: poetry-local-${{ matrix.python-version }}${{ hashFiles('**/poetry.lock') }}
- name: Cache Poetry cache
uses: actions/cache@v3
with:
path: ~/.cache/pypoetry
key: poetry-cache-${{ matrix.python-version }}${{ hashFiles('**/poetry.lock') }}
- name: Install mkdocs-material social dependencies
run: sudo apt-get install libcairo2-dev libfreetype6-dev libffi-dev libjpeg-dev libpng-dev libz-dev
- name: Install and configure Poetry
uses: snok/install-poetry@v1
with:
version: 1.5.1
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
- name: Install dependencies
run: poetry install
- name: Create setting.py
run: mv setting_sample.py setting.py
- name: Create docs .cache folder
run: cd docs_dev; mkdir -p .cache/plugin/social
- name: Load Noto Sans TC font
run: cd docs_dev/.cache/plugin/social; wget https://volunteer.coscup.org/doc/NotoSansTC-Bold.otf;
- name: Load Iansui094 font
run: cd docs_dev/.cache/plugin/social; wget https://volunteer.coscup.org/doc/Iansui094-Regular.ttf -O NotoSansTC-Regular.ttf;
- name: Build Docs
env:
PYTHONPATH: "../"
run: cd docs_dev; poetry run mkdocs -v build;
- name: Upload to S3
env:
AWS_ACCESS_KEY_ID: ${{ secrets.DOC_S3_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.DOC_S3_KEY }}
run: cd docs_dev; poetry run aws s3 sync ./site s3://coscup-volunteer-docs/ --acl public-read