Skip to content

Update vendor infos #225

Update vendor infos

Update vendor infos #225

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@v4
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@v5
with:
python-version: ${{ matrix.python-version }}
- name: Cache Poetry venv
uses: actions/cache@v4
with:
path: ./.venv
key: poetry-venv-${{ matrix.python-version }}${{ hashFiles('**/poetry.lock') }}
- name: Cache Poetry local
uses: actions/cache@v4
with:
path: ~/.local/share/pypoetry
key: poetry-local-${{ matrix.python-version }}${{ hashFiles('**/poetry.lock') }}
- name: Cache Poetry cache
uses: actions/cache@v4
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.8.2
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/fonts/Noto\ Sans\ TC
- name: Load Noto Sans TC font
run: cd docs_dev/.cache/plugin/social/fonts/Noto\ Sans\ TC; wget https://volunteer.coscup.org/doc/NotoSansTC-Bold.ttf -O Bold.ttf;
- name: Load Iansui094 font
run: cd docs_dev/.cache/plugin/social/fonts/Noto\ Sans\ TC; wget https://volunteer.coscup.org/doc/Iansui094-Regular.ttf -O Regular.ttf;
- name: manual install mkdocs-material
run: git clone https://github.com/squidfunk/mkdocs-material.git; poetry add ./mkdocs-material/;
- name: Build Docs
env:
PYTHONPATH: "../"
run: cd docs_dev; poetry run mkdocs -v build -s;
- name: Replaces og Junior Workshop
run: cd docs_dev/site/assets/images/social/about_coscup/junior_workshop/; wget https://volunteer.coscup.org/img/2024/coscup_junior_workshop_2024_1.png -O ./overview.png; cp ./overview.png ./overview.zh-TW.png;
- name: Replaces og Healing Market
run: cd docs_dev/site/assets/images/social/about_coscup/health_market/; wget https://secretary.coscup.org/s3/img/2022_yoga_1600.jpg -O ./overview.png; cp ./overview.png ./overview.zh-TW.png;
- name: Replaces og Eve Gathering
run: cd docs_dev/site/assets/images/social/about_coscup/eve_gathering/; wget https://volunteer.coscup.org/img/2024/eve_gathering.jpg -O ./overview.png; cp ./overview.png ./overview.zh-TW.png;
- name: Replaces og Healing Lectures
run: cd docs_dev/site/assets/images/social/about_coscup/healing_lectures/; wget https://volunteer.coscup.org/img/2024/healing_lectures.jpg -O ./overview.png; cp ./overview.png ./overview.zh-TW.png;
- name: Replaces og Fun Fair
run: cd docs_dev/site/assets/images/social/about_coscup/fun_fair/; wget https://volunteer.coscup.org/img/2024/fun_fair.jpg -O ./overview.png; cp ./overview.png ./overview.zh-TW.png;
- name: Replaces og Attendee Services
run: cd docs_dev/site/assets/images/social/about_coscup/attendee_services/; wget https://volunteer.coscup.org/img/2024/attendee_services.jpg -O ./index.png; cp ./index.png ./index.zh-TW.png;
- name: Replaces og AS Attendee
run: cd docs_dev/site/assets/images/social/about_coscup/how_to_participate/; wget https://volunteer.coscup.org/doc/2022/bof_giveaways.webp -O ./as_attendee.png; cp ./as_attendee.png ./as_attendee.zh-TW.png;
- name: Clean the all files
env:
AWS_ACCESS_KEY_ID: ${{ secrets.DOC_S3_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.DOC_S3_KEY }}
run: poetry run aws s3 rm s3://coscup-volunteer-docs --recursive
- 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