From a3591f06c2456cf7998232e5a35a107bafe424e7 Mon Sep 17 00:00:00 2001 From: svaponi <10941963+svaponi@users.noreply.github.com> Date: Sun, 21 Jul 2024 12:22:30 +0200 Subject: [PATCH] task: remove mkdocs, add jekyll --- .github/workflows/jekyll-gh-pages.yml | 52 +++++++++++++++++++++++++++ .github/workflows/mkdocs.yaml | 30 ---------------- CONTRIBUTING.md | 19 ++++++++++ README.md | 18 ++++++++-- _config.yml | 2 ++ docs/gcloud.md | 29 --------------- docs/index.md | 3 -- docs/setup.md | 22 ------------ mkdocs.yml | 8 ----- 9 files changed, 89 insertions(+), 94 deletions(-) create mode 100644 .github/workflows/jekyll-gh-pages.yml delete mode 100644 .github/workflows/mkdocs.yaml create mode 100644 CONTRIBUTING.md create mode 100644 _config.yml delete mode 100644 docs/gcloud.md delete mode 100644 docs/index.md delete mode 100644 docs/setup.md delete mode 100644 mkdocs.yml diff --git a/.github/workflows/jekyll-gh-pages.yml b/.github/workflows/jekyll-gh-pages.yml new file mode 100644 index 0000000..3d4363d --- /dev/null +++ b/.github/workflows/jekyll-gh-pages.yml @@ -0,0 +1,52 @@ +# Sample workflow for building and deploying a Jekyll site to GitHub Pages +name: Deploy Jekyll with GitHub Pages dependencies preinstalled + +on: + # Runs on pushes targeting the default branch + push: + branches: ["main"] + paths: ['**.md'] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +permissions: + contents: read + pages: write + id-token: write + +# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. +# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. +concurrency: + group: "pages" + cancel-in-progress: false + +jobs: + # Build job + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Setup Pages + uses: actions/configure-pages@v5 + - name: Build with Jekyll + uses: actions/jekyll-build-pages@v1 + with: + source: ./ + destination: ./_site + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + + # Deployment job + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + needs: build + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 diff --git a/.github/workflows/mkdocs.yaml b/.github/workflows/mkdocs.yaml deleted file mode 100644 index ae426cf..0000000 --- a/.github/workflows/mkdocs.yaml +++ /dev/null @@ -1,30 +0,0 @@ -# Builds the docs using mkdocs and pushes the result to `gh-pages` branch. -name: Docs -run-name: Build Docs 📄 -on: - push: - branches: - - main -permissions: - contents: write -jobs: - deploy: - runs-on: ubuntu-latest - strategy: - matrix: - python-version: [ "3.12" ] - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Set up python ${{ matrix.python-version }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - cache: 'pip' - - name: Install Requirements - run: | - sudo apt-get update && - sudo apt-get install pngquant && - pip install mkdocs-material mkdocs-material-extensions pillow cairosvg - - name: Build and deploy MkDocs - run: mkdocs gh-deploy --force diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..cd8b9c1 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,19 @@ +## Contributing + +Clone the project and open it in you favorite IDE. + +```bash +git clone git@github.com:svaponi/hello-pypi.git +``` + +Install dependencies with [Poetry](https://python-poetry.org/docs/#installation). + +````sh +poetry install +```` + +Run the tests. + +```shell +python -m pytest +``` diff --git a/README.md b/README.md index d0d8a14..1f010ad 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,17 @@ -# fastapi-boilerplate +# FastAPI Boilerplate -Kickstart your [FastAPI](https://fastapi.tiangolo.com/) development with ease. +[![Test](https://github.com/svaponi/fastapi-boilerplate/actions/workflows/run-tests.yml/badge.svg)](https://github.com/svaponi/fastapi-boilerplate/actions/workflows/run-tests.yml) +[![Coverage Status](https://coveralls.io/repos/github/svaponi/fastapi-boilerplate/badge.svg?branch=main)](https://coveralls.io/github/svaponi/fastapi-boilerplate?branch=main) + +Boilerplate repository to kickstart 🚀 your [FastAPI](https://fastapi.tiangolo.com/) project. + +### Key features + +- Run [pytest](https://docs.pytest.org/) when you **push changes to `src/` dir** ([GitHub Actions](/.github/workflows/run-tests.yml)). +- [Poetry](https://python-poetry.org/docs/#installation) as **dependency manager** and **packaging tool**. +- [Coveralls](https://docs.coveralls.io/) integration (for coverage badge). + + +## Contributing + +See [CONTRIBUTING.md](/CONTRIBUTING.md). diff --git a/_config.yml b/_config.yml new file mode 100644 index 0000000..c9e2c27 --- /dev/null +++ b/_config.yml @@ -0,0 +1,2 @@ +name: true +title: false \ No newline at end of file diff --git a/docs/gcloud.md b/docs/gcloud.md deleted file mode 100644 index 9a03b02..0000000 --- a/docs/gcloud.md +++ /dev/null @@ -1,29 +0,0 @@ -# Google Cloud Integration - -This page contains information on how to configure the application to use resources on Google Cloud. -Use-cases: - -- Install private dependencies published on [Artifact Registry](https://cloud.google.com/artifact-registry). -- Publish docker image on [Artifact Registry](https://cloud.google.com/artifact-registry). -- Deploy to [Google Kubernetes Engine (GKE)](https://cloud.google.com/kubernetes-engine). -- Deploy to [Cloud Run](https://cloud.google.com/run). - -## Install Google Cloud CLI - -- Install it from the [GCloud Installation](https://cloud.google.com/sdk/docs/install) page. -- Run in terminal: - -```shell -gcloud init -``` - -- You will be asked to sign via Google Sign On. -- Choose your project from the menu. - -## Add Google Cloud implementation of keyring to Poetry - -1. Run in terminal: - -```sh -poetry self add keyrings.google-artifactregistry-auth -``` diff --git a/docs/index.md b/docs/index.md deleted file mode 100644 index 75a51a8..0000000 --- a/docs/index.md +++ /dev/null @@ -1,3 +0,0 @@ -# FastAPI Boilerplate - -Kickstart your [FastAPI](https://fastapi.tiangolo.com/) development with ease. diff --git a/docs/setup.md b/docs/setup.md deleted file mode 100644 index 5fc5d94..0000000 --- a/docs/setup.md +++ /dev/null @@ -1,22 +0,0 @@ -# Setup - -This page contain information on how to set up the project locally. - -## Install Poetry - -- Install it from the [Poetry Installation](https://python-poetry.org/docs/#installation) page. -- Check the installation by running: - -```shell -poetry --version -``` - -- Make sure your version is **>=1.2.2**. - -### Install Dependencies via Poetry - -- Run in terminal: - -```sh -poetry install -``` diff --git a/mkdocs.yml b/mkdocs.yml deleted file mode 100644 index 8e9f98c..0000000 --- a/mkdocs.yml +++ /dev/null @@ -1,8 +0,0 @@ -site_name: FastAPI Boilerplate -site_url: https://svaponi.github.io/fastapi-boilerplate -nav: - - Home: index.md - - Setup: setup.md - - Cloud Integration: - - Google Cloud: gcloud.md -theme: readthedocs