diff --git a/.forgejo/workflows/action.yaml b/.forgejo/workflows/action.yaml new file mode 100644 index 0000000..dbfd924 --- /dev/null +++ b/.forgejo/workflows/action.yaml @@ -0,0 +1,51 @@ +name: Push documentation to Meli and run Pylint +on: [push, pull_request] + +jobs: + setup: + runs-on: docker + strategy: + matrix: + python-version: ["3.11"] + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v2 + 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 config virtualenvs.create false + poetry install --with docs --with dev --no-root + + build-documentation: + needs: setup + runs-on: ubuntu-latest + steps: + - name: Build the documentation + run: | + export PATH="$HOME/.local/bin:$PATH" + mkdocs build + - name: Deploy the documentation to Meli + run: | + npx -p "@getmeli/cli" meli upload ./site \ + --url "http://pages.coastalcommits.com" \ + --site "${{ secrets.MELI_SITE }}" \ + --token "${{ secrets.MELI_SITE_SECRET }}" \ + --release "$GITHUB_SHA" + env: + GITEA_TOKEN: ${{ secrets.COASTALCOMMITSTOKEN }} + + pylint: + needs: setup + runs-on: docker + steps: + - 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')