Skip to content

Commit

Permalink
chore: CI and docs update
Browse files Browse the repository at this point in the history
  • Loading branch information
GabDug committed Jan 25, 2024
1 parent 6d2a4a9 commit 40975cf
Show file tree
Hide file tree
Showing 8 changed files with 178 additions and 39 deletions.
1 change: 1 addition & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
version: 2
updates:

Expand Down
67 changes: 67 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
---
on:
workflow_dispatch:
push:
branches: [main]
pull_request:

name: Mkdocs CI

concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true

env:
PYTHON_VERSION: "3.11"

jobs:
docs:
name: Test, build and deploy docs
env:
PYTHONDEVMODE: 1

runs-on: "ubuntu-latest"

strategy:
fail-fast: false
matrix:
python-version: ["3.11"]

permissions:
contents: write

steps:
- uses: actions/checkout@v4
- name: Setup PDM
# XXX Use the upstream version when repository is not private
uses: ManoManoTech/setup-pdm@main
id: setup-pdm
with:
python-version: ${{ matrix.python-version }}
cache: true
allow-python-prereleases: true

- name: Install dependencies
run: pdm install -v && pdm info

- name: "Check for mkdocs build --strict"
run: |
pdm run docs-build --strict
# If pull request or not main branch and not a tag
if: github.event_name == 'pull_request' || (github.event_name == 'push' && github.ref != 'refs/heads/main' && !startsWith(github.ref, 'refs/tags/')) || github.event_name == 'workflow_dispatch'

- name: Deploy docs (dev)
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
run: |
export SHORT_SHA=$(echo "${GITHUB_SHA}" | cut -c1-7)
pdm run mike deploy dev --update-aliases --title "dev (${SHORT_SHA})" --push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Deploy docs (tag)
if: startsWith(github.ref, 'refs/tags/') && github.event_name == 'push'
run: |
pdm run mike deploy ${{ github.ref }} latest --push --update-aliases
pdm run mike set-default latest --push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7 changes: 7 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ jobs:
with:
ref: ${{ inputs.sha }}

- name: Set local tag for version
if: ${{ inputs.tag }}
run: |
git config user.email "[email protected]"
git config user.name "FireFighter Release CI"
git tag -m "v${{ inputs.tag }}" "v${{ inputs.tag }}"
- name: Setup Python & PDM
# XXX Use the upstream version when repository is not private
uses: ManoManoTech/setup-pdm@main
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sync_python_deps.yml.disabled
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: Update Python dependencies with PDM
# Other dependeices updates are managed dy renovatebot
# Other dependencies updates are managed by renovatebot

on:
schedule:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# FireFighter

![PyPI - Version](https://img.shields.io/pypi/v/firefighter-incident) ![PyPI - Python Version](https://img.shields.io/pypi/pyversions/firefighter-incident) ![PyPI - License](https://img.shields.io/pypi/l/firefighter-incident) [![OpenSSF Best Practices](https://www.bestpractices.dev/projects/8170/badge)](https://www.bestpractices.dev/projects/8170) [![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit)](https://github.com/pre-commit/pre-commit) [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) [![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
[![PyPI - Version](https://img.shields.io/pypi/v/firefighter-incident)](https://pypi.org/project/firefighter-incident/) [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/firefighter-incident)](https://pypi.org/project/firefighter-incident/) [![PyPI - License](https://img.shields.io/pypi/l/firefighter-incident)](https://manomanotech.github.io/firefighter-incident/latest/license/) [![OpenSSF Best Practices](https://www.bestpractices.dev/projects/8170/badge)](https://www.bestpractices.dev/projects/8170) [![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit)](https://github.com/pre-commit/pre-commit) [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) [![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)

FireFighter is ManoMano's in-house Incident Management Tool.

Expand Down
9 changes: 9 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,14 @@ extra:
generator: false
version:
provider: mike
default:
- latest
- dev
social:
- icon: fontawesome/brands/github
link: https://github.com/ManoManoTech/firefighter-incident
- icon: fontawesome/brands/python
link: https://pypi.org/project/firefighter-incident/

nav:
- Home:
Expand Down Expand Up @@ -170,12 +175,16 @@ plugins:
- markdown-exec
- search
- section-index
- social:
enabled: !ENV [CI, false]
- mike:
canonical_version: "latest"
version_selector: true
- redirects:
redirect_maps:
contributing.md: contributing/0000-README.md
- minify:
minify_html: true
- mkdocstrings:
handlers:
python:
Expand Down
Loading

0 comments on commit 40975cf

Please sign in to comment.