From 4a790d90d8eafc7908f41a0bda70348474b93e24 Mon Sep 17 00:00:00 2001 From: SeaswimmerTheFsh Date: Fri, 5 Jan 2024 13:02:44 +0000 Subject: [PATCH] misc(docs): moving to a selfhosted docker container instead of readthedocs --- .forgejo/workflows/build-docs.yml | 33 +++++++++++++++++++++++++++++++ .readthedocs.yml | 23 --------------------- Dockerfile | 21 ++++++++++++++++++++ 3 files changed, 54 insertions(+), 23 deletions(-) create mode 100644 .forgejo/workflows/build-docs.yml delete mode 100644 .readthedocs.yml create mode 100644 Dockerfile diff --git a/.forgejo/workflows/build-docs.yml b/.forgejo/workflows/build-docs.yml new file mode 100644 index 0000000..6c21580 --- /dev/null +++ b/.forgejo/workflows/build-docs.yml @@ -0,0 +1,33 @@ + +name: Build Documentation +on: + push: + branches: + - master + +jobs: + Build: + runs-on: docker + container: catthehacker/ubuntu:act-latest + steps: + - name: Checkout code + uses: actions/checkout@v3 + with: + token: ${{ secrets.COASTALCOMMITSTOKEN }} + - name: Login to CoastalCommits + uses: actions/docker-login@v3 + with: + registry: coastalcommits.com + username: SeaswimmerTheFsh + password: ${{ secrets.COASTALCOMMITSTOKEN }} + - name: Build and push Docker image + uses: actions/docker-build-push@v5 + with: + context: . + file: Dockerfile + push: true + tags: coastalcommits.com/seaswimmerthefsh/seacogs-docs:latest + - name: Update Portainer stack + uses: actions/http@master + with: + url: ${{ secrets.PORTAINER_WEBHOOK }} diff --git a/.readthedocs.yml b/.readthedocs.yml deleted file mode 100644 index d099303..0000000 --- a/.readthedocs.yml +++ /dev/null @@ -1,23 +0,0 @@ -version: 2 - -build: - os: "ubuntu-22.04" - apt_packages: - - libcairo2-dev - - libfreetype6-dev - - libffi-dev - - libjpeg-dev - - libpng-dev - - libz-dev - - pngquant - tools: - python: "3.11" - jobs: - post_create_environment: - - pip install poetry - - poetry config virtualenvs.create false - post_install: - - poetry install --with docs - -mkdocs: - configuration: mkdocs.yml diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..d3e1552 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,21 @@ +from python:3.11 +RUN pip install --upgrade pip poetry +COPY pyproject.toml poetry.lock / + +RUN apt install -y / + libcairo2-dev / + libfreetype6-dev / + libjpeg-dev / + libffi-dev / + libpng-dev / + libz-dev / + pngquant +RUN poetry config virtualenvs.create false +RUN poetry install -n --with docs + +COPY .docs /.docs +COPY mkdocs.yml / + +WORKDIR /.docs +EXPOSE 8000 +CMD ["mkdocs", "serve", "--dev-addr=0.0.0.0:8000"]