mkusz / mkdocs-publisher

Publisher for MkDocs - a set of plugins for content creators
https://mkusz.github.io/mkdocs-publisher/
MIT License
43 stars 1 forks source link

Deploy Pages Error #62

Open dr-code opened 8 months ago

dr-code commented 8 months ago

Bug description

Hello

I managed to get this up and running on my local server. When I try to publish it to GitHub, I get an error: image

I had made a copy of your deploy_pages.yml file. I have attached it here. I will also attach the pyproject.toml file here. In your files it seems like there is a file called poetry.lock that gets generated automatically, but that does not seem to be the case for me and I think that's where the problem is.

name: Deploy Pages
on:
  workflow_dispatch:
  push:
    branches:
      - main
  schedule:
    - cron: '0 */8 * * *'
jobs:
  deploy-pages:
    runs-on: ubuntu-latest
    steps:
      - name: Install poetry
        run: pipx install --python python poetry==1.5.1
      - name: Checkout git repository
        uses: actions/checkout@v4
        with:
          fetch-depth: 0
      - name: Install Python 3.10
        uses: actions/setup-python@v4
        with:
          python-version: '3.10'
          architecture: 'x64'
          cache: 'poetry'
      - name: Install Python dependencies
        run: poetry install -n
      - name: Install Node.js
        uses: actions/setup-node@v3
        with:
          node-version: '18'
          architecture: 'x64'
          cache: 'npm'
      - name: Install npm packages
        # yamllint disable-line rule:line-length
        run: npm install --no-fund -f -g svgo html-minifier postcss cssnano postcss-svgo postcss-cli uglify-js
      - name: Install additional Ubuntu packages
        uses: awalsh128/cache-apt-pkgs-action@latest
        with:
          packages: rustc pngquant libjpeg-turbo-progs
          version: 'ubuntu'
      - name: Install oxipng
        uses: baptiste0928/cargo-install@v2
        with:
          crate: oxipng
      - name: Restore MkDocs cached files
        uses: actions/cache@v3
        with:
          path: .pub_min_cache
          key: mkdocs-publisher-cache-${{ github.run_id }}
          restore-keys: mkdocs-publisher-cache-
      - name: Build mkdocs-publisher documentation
        run: poetry run mkdocs build -c
      - name: Store documentation build and debug logs as artifacts
        uses: actions/upload-artifact@v3
        with:
          name: docs-build-logs
          if-no-files-found: ignore
          retention-days: 1
          path: |
            *_mkdocs_build.log
            *_mkdocs_debug.zip
      - name: Commit static site to repository with GitHub Pages enabled
        uses: cpina/github-action-push-to-another-repository@main
        env:
          API_TOKEN_GITHUB: ${{ secrets.DEPLOY_PAGES_TOKEN }}
        with:
          user-name: ${{ secrets.USER_NAME }}
          user-email: ${{ secrets.USER_EMAIL }}
          source-directory: docs
          destination-github-username: ${{ secrets.USER_NAME }}
          destination-repository-name: mkdocs-publisher
          target-branch: docs
      - name: Save MkDocs files cache
        uses: actions/cache/save@v3
        with:
          path: .pub_min_cache
          key: mkdocs-publisher-cache-${{ github.run_id }}

below is the pyproject.toml file:

[tool.poetry]
name = "mkdocs-publisher"
version = "1.1.1"
description = "Publisher for MkDocs - set of plugins for content creators"
authors = ["Maciej 'maQ' Kusz <maciej.kusz@gmail.com>"]
license = "BSD"
readme = "README.md"
keywords = [
    "mkdocs",
    "mkdocs-plugin",
    "blog",
    "categories",
    "debugger",
    "docs",
    "documentation",
    "frontmatter",
    "markdown",
    "minifier",
    "navigation",
    "obsidian",
    "publisher",
    "tags",
]
packages = [
    {include = "mkdocs_publisher"},
]
classifiers = [
    "Development Status :: 4 - Beta",
    "Environment :: Console",
    "Environment :: Web Environment",
    "Intended Audience :: Education",
    "Intended Audience :: Developers",
    "Intended Audience :: Information Technology",
    "Intended Audience :: Other Audience",
    "License :: OSI Approved :: MIT License",
    "Operating System :: OS Independent",
    "Programming Language :: Python",
    "Programming Language :: Python :: 3",
    "Programming Language :: Python :: 3.9",
    "Programming Language :: Python :: 3.10",
    "Programming Language :: Python :: 3.11",
    "Programming Language :: Python :: 3.12",
    "Programming Language :: Python :: 3.13",
    "Programming Language :: Python :: 3 :: Only",
    "Topic :: Documentation",
    "Topic :: Text Editors :: Documentation",
    "Topic :: Text Processing",
    "Topic :: Text Processing :: Markup",
    "Topic :: Text Processing :: Markup :: Markdown",
    "Topic :: Utilities",
]
homepage = "https://github.com/mkusz/mkdocs-publisher"
repository = "https://github.com/dr-code/pccm-kb"
documentation = "https://mkusz.github.io/mkdocs-publisher"

[tool.poetry.urls]
"Bug Tracker" = "https://github.com/mkusz/mkdocs-publisher/issues"

[tool.poetry.dependencies]
python = "^3.9"
mkdocs = "^1.5.3"
pymdown-extensions = "^10.3"
beautifulsoup4 = "^4.12.2"
mkdocs-material = "^9.4.4"

[tool.poetry.group.dev.dependencies]
isort = "^5.12.0"
black = "^22.12.0"
yamllint = "^1.29.0"
pyright = "1.1.323"
ruff = "^0.0.292"

[tool.poetry.group.test.dependencies]
coverage = "^7.3.2"
pytest = "^7.4.2"
pytest-cov = "^4.1.0"

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

[tool.black]
line-length = 99

[tool.isort]
py_version=39
profile = "black"
line_length = 99
force_single_line = true
src_paths = [
    "mkdocs_publisher",
    "tests",
]

[tool.pyright]
extraPaths = [
    "mkdocs_publisher",
]
include = [
    "mkdocs_publisher",
    "tests",
]
exclude = [
    "docs",
    "mkdocs_publisher_docs",
]
reportMissingImports = false
reportMissingTypeStubs = false
reportOptionalMemberAccess = false
typeCheckingMode = "basic"

[tool.pytest.ini_options]
addopts = "--tb=short --log-level=DEBUG --cov-report=html --cov=mkdocs_publisher"
markers = [
    "deprecated: Tests no longer used",
    ]
testpaths = [
    "tests",
]

[tool.ruff]
target-version = "py39"
line-length = 99

[tool.ruff.mccabe]
max-complexity = 10

[tool.coverage.run]
branch = true

[tool.coverage.report]
include_namespace_packages = true
skip_empty = true
skip_covered = false

[tool.poetry.plugins."mkdocs.plugins"]
pub-blog = "mkdocs_publisher.blog.plugin:BlogPlugin"
pub-debugger = "mkdocs_publisher.debugger.plugin:DebuggerPlugin"
pub-meta = "mkdocs_publisher.meta.plugin:MetaPlugin"
pub-minifier = "mkdocs_publisher.minifier.plugin:MinifierPlugin"
pub-obsidian = "mkdocs_publisher.obsidian.plugin:ObsidianPlugin"
pub-social = "mkdocs_publisher.social.plugin:SocialPlugin"

[tool.poetry.scripts]
mkdocs-pub = "mkdocs_publisher._cli.publisher:app"

Appreciate any help!

Expected behaviour

deploy the page and be able to open it in GitHub pages.

Reproduction steps

No response

Operating system

macOS

Python version

3.10

Link to git repository

https://github.com/dr-code/pccm-kb

Log output

No response

Contact details

rutvik11@gmail.com

mkusz commented 8 months ago

Hi @dr-code , The error you see is related to how you are solving Python dependencies. Have you ever created any mkdocs documentation before? If not, please remove pyproject.toml file (it will not work for you anyway). After that it all depends on if you want to use pure pip or poetry for Python dependencies management. Depends on your decision, you need to do other preparations and do some changes in workflow file (deploy_pages.yml). If you don't know how to start, please let me know, and I will try to do here some description and letter on a full documentation based on that.