From 35937b63efaee5a18c0bc5f3d1dff7127644835d Mon Sep 17 00:00:00 2001 From: SeaswimmerTheFsh Date: Mon, 15 Jan 2024 05:52:17 -0500 Subject: [PATCH] feat(docs): moved to CoastalCommits pages --- .forgejo/workflows/pylint.yaml | 28 -------------- .forgejo/workflows/workflow.yaml | 64 ++++++++++++++++++++++++++++++++ .readthedocs.yml | 23 ------------ mkdocs.yml | 4 +- 4 files changed, 66 insertions(+), 53 deletions(-) delete mode 100644 .forgejo/workflows/pylint.yaml create mode 100644 .forgejo/workflows/workflow.yaml delete mode 100644 .readthedocs.yml diff --git a/.forgejo/workflows/pylint.yaml b/.forgejo/workflows/pylint.yaml deleted file mode 100644 index 43f8e30..0000000 --- a/.forgejo/workflows/pylint.yaml +++ /dev/null @@ -1,28 +0,0 @@ -name: Pylint -on: [push] - -jobs: - Pylint: - runs-on: docker - strategy: - matrix: - python-version: ["3.12"] - container: catthehacker/ubuntu:act-latest - steps: - - name: Checkout - uses: actions/checkout@v3.6.0 - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - - name: Install Poetry - run: curl -sSL https://cdn.seaswimmer.cc/go/poetry | python${{ matrix.python-version }} - - - name: Install dependencies - run: | - export PATH="$HOME/.local/bin:$PATH" - poetry env use ${{ matrix.python-version }} - poetry install --with dev - - name: Analysing the code with Pylint - run: | - export PATH="$HOME/.local/bin:$PATH" - poetry run pylint --rcfile .forgejo/workflows/config/.pylintrc $(git ls-files '*.py') diff --git a/.forgejo/workflows/workflow.yaml b/.forgejo/workflows/workflow.yaml new file mode 100644 index 0000000..c720027 --- /dev/null +++ b/.forgejo/workflows/workflow.yaml @@ -0,0 +1,64 @@ +name: Actions +on: + push: + branches: + - 'main' + pull_request: + +jobs: + Lint Code (Pylint): + runs-on: docker + container: coastalcommits.com/seaswimmerthefsh/actionscontainers-pyzipline:latest + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Install dependencies + run: poetry install --with dev --no-root + + - name: Analysing code with Pylint + run: pylint --rcfile .forgejo/workflows/config/.pylintrc $(git ls-files '*.py') + + Build Documentation (MkDocs): + runs-on: docker + container: coastalcommits.com/seaswimmerthefsh/actionscontainers-pyzipline:latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Install dependencies + run: poetry install --with docs --no-root + + - name: Set environment variables + uses: actions/env@v2 + + - name: Build documentation + run: | + export SITE_URL="https://$CI_ACTION_REF_NAME_SLUG.pyzipline.coastalcommits.com" + export EDIT_URI="src/branch/$CI_ACTION_REF_NAME/docs" + mkdocs build -v + + - name: Deploy documentation + run: | + GREEN='\033[0;32m' + YELLOW='\033[0;33m' + BLUE='\033[0;34m' + + unset GITHUB_TOKEN + unset GITLAB_TOKEN + + echo "${YELLOW}Deploying to ${BLUE}Meli ${YELLOW}on branch ${GREEN}$CI_ACTION_REF_NAME_SLUG${YELLOW}...\n" + + npx -p "@getmeli/cli" meli upload ./site \ + --url "https://pages.coastalcommits.com" \ + --site "${{ vars.MELI_SITE_ID }}" \ + --token "${{ secrets.MELI_SITE_SECRET }}" \ + --release "$CI_ACTION_REF_NAME_SLUG/${{ env.GITHUB_SHA }}" \ + --branch "$CI_ACTION_REF_NAME_SLUG" + + echo "\n${YELLOW}Deployed to ${BLUE}Meli ${YELLOW}on branch ${GREEN}$CI_ACTION_REF_NAME_SLUG${YELLOW}!" + echo "${GREEN}https://$CI_ACTION_REF_NAME_SLUG.pyzipline.coastalcommits.com/" + env: + GITEA_TOKEN: ${{ secrets.COASTALCOMMITSTOKEN }} diff --git a/.readthedocs.yml b/.readthedocs.yml deleted file mode 100644 index c7159e9..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.12" - 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/mkdocs.yml b/mkdocs.yml index 6af6ebc..8588574 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -1,8 +1,8 @@ site_name: PyZipline Documentation -site_url: https://pyzipline.readthedocs.io +site_url: !ENV SITE_URL repo_name: CoastalCommits repo_url: https://coastalcommits.com/SeaswimmerTheFsh/PyZipline -edit_uri: src/branch/main/docs +edit_uri: !ENV EDIT_URI copyright: Copyright © 2023, SeaswimmerTheFsh site_author: SeaswimmerTheFsh