From 93baf9c0054f8623885fb658bc8299b8126c8e42 Mon Sep 17 00:00:00 2001 From: Marcelo Trylesinski Date: Fri, 20 Sep 2024 20:28:28 +0200 Subject: [PATCH] Publish documentation on tag push (#330) * Publish documentation on tag * More meaningful name * Add check * Run mkdocs with uv --- .github/workflows/docs.yml | 34 ++++++++++++++++++++++++++++++++++ .github/workflows/test.yml | 11 +++++++++++ CONTRIBUTING.md | 4 ++-- docs/contributing.md | 31 +++++++++++++++++-------------- docs/index.md | 2 +- mkdocs.yml | 22 +++++++++++----------- 6 files changed, 76 insertions(+), 28 deletions(-) create mode 100644 .github/workflows/docs.yml diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 00000000..c6000019 --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,34 @@ +name: Deploy Documentation + +on: + push: + tags: + - "**" + +permissions: + contents: write + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Configure Git Credentials + run: | + git config user.name github-actions[bot] + git config user.email 41898282+github-actions[bot]@users.noreply.github.com + + - name: Install uv + uses: astral-sh/setup-uv@v2 + with: + version: "0.4.12" + enable-cache: true + + - name: Set up Python + run: uv python install 3.12 + + - name: Install dependencies + run: uv sync --frozen + + - run: uv run mkdocs gh-deploy --force diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5b32e210..e8b2a51d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -32,3 +32,14 @@ jobs: - name: Run linters run: scripts/lint + + # https://github.com/marketplace/actions/alls-green#why used for branch protection checks + check: + if: always() + needs: [test] + runs-on: ubuntu-latest + steps: + - name: Decide whether the needed jobs succeeded or failed + uses: re-actors/alls-green@release/v1 + with: + jobs: ${{ toJSON(needs) }} diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8c6a4c36..db5ade07 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -106,9 +106,9 @@ The issue [tracker](https://github.com/jordaneremieff/mangum/issues) can be used Here are a few things you might consider before opening a new issue: -- Is this covered in the [documentation](https://mangum.io/)? +- Is this covered in the [documentation](https://mangum.fastapiexpert.com/)? -- Is there already a related issue in the [tracker](https://github.com/jordaneremieff/mangum/issues)? +- Is there already a related issue in the [tracker](https://github.com/Kludex/mangum/issues)? - Is this a problem related to Mangum itself or a third-party dependency? diff --git a/docs/contributing.md b/docs/contributing.md index fe101090..def12a59 100644 --- a/docs/contributing.md +++ b/docs/contributing.md @@ -4,18 +4,21 @@ Hello. Contributions to this project are highly encouraged and appreciated. This ## Contents -- [Creating a pull request](#creating-a-pull-request) - * [Setting up the repository](#setting-up-the-repository) -- [Developing the project locally](#developing-the-project-locally) - * [Setup](#setup) - * [Test](#test) - + [Coverage requirements](#coverage-requirements) - * [Lint](#lint) - + [Code style and formatting](#code-style-and-formatting) - + [Static type checking](#static-type-checking) -- [Using the issue tracker](#using-the-issue-tracker) - * [Technical support](#technical-support) - * [Feature requests](#feature-requests) +- [Contributing to Mangum](#contributing-to-mangum) + - [Contents](#contents) + - [Creating a pull request](#creating-a-pull-request) + - [Setting up the repository](#setting-up-the-repository) + - [Developing the project locally](#developing-the-project-locally) + - [Setup](#setup) + - [Test](#test) + - [Coverage requirements](#coverage-requirements) + - [Lint](#lint) + - [Code style and formatting](#code-style-and-formatting) + - [Static type checking](#static-type-checking) + - [Using the issue tracker](#using-the-issue-tracker) + - [Technical support](#technical-support) + - [Feature requests](#feature-requests) + - [Thank you](#thank-you) ## Creating a pull request @@ -103,9 +106,9 @@ The issue [tracker](https://github.com/jordaneremieff/mangum/issues) can be used Here are a few things you might consider before opening a new issue: -- Is this covered in the [documentation](https://mangum.io/)? +- Is this covered in the [documentation](https://mangum.fastapiexpert.com/)? -- Is there already a related issue in the [tracker](https://github.com/jordaneremieff/mangum/issues)? +- Is there already a related issue in the [tracker](https://github.com/Kludex/mangum/issues)? - Is this a problem related to Mangum itself or a third-party dependency? diff --git a/docs/index.md b/docs/index.md index b674e8c2..0f78c46c 100644 --- a/docs/index.md +++ b/docs/index.md @@ -10,7 +10,7 @@ Mangum is an adapter for running [ASGI](https://asgi.readthedocs.io/en/latest/) applications in AWS Lambda to handle Function URL, API Gateway, ALB, and Lambda@Edge events. -***Documentation***: https://mangum.io/ +***Documentation***: https://mangum.fastapiexpert.com/ ## Features diff --git a/mkdocs.yml b/mkdocs.yml index 80c94abe..83c72e2d 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -1,6 +1,6 @@ site_name: Mangum site_description: AWS Lambda & API Gateway support for ASGI -site_url: http://mangum.io/ +site_url: http://mangum.fastapiexpert.com theme: name: "material" @@ -8,18 +8,18 @@ theme: primary: "brown" accent: "orange" -repo_name: jordaneremieff/mangum -repo_url: https://github.com/jordaneremieff/mangum -edit_uri: "" +repo_name: Kludex/mangum +repo_url: https://github.com/Kludex/mangum +edit_uri: edit/main/docs/ nav: - - Introduction: "index.md" - - Adapter: "adapter.md" - - HTTP: "http.md" - - Lifespan: "lifespan.md" - - ASGI Frameworks: "asgi-frameworks.md" - - External Links: "external-links.md" - - Contributing: "contributing.md" + - Introduction: index.md + - Adapter: adapter.md + - HTTP: http.md + - Lifespan: lifespan.md + - ASGI Frameworks: asgi-frameworks.md + - External Links: external-links.md + - Contributing: contributing.md markdown_extensions: - mkautodoc