Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ customRules:
- "markdownlint-rule-max-one-sentence-per-line"

outputFormatters:
- - markdownlint-cli2-formatter-default
- - markdownlint-cli2-formatter-codequality
- - markdownlint-cli2-formatter-pretty
- - markdownlint-cli2-formatter-sarif
93 changes: 93 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
name: ci

on:
push:
branches:
- main
pull_request:
workflow_dispatch:
merge_group:

concurrency:
group: "${{ github.ref }}"
cancel-in-progress: true


jobs:
lint:
runs-on: ubuntu-latest
permissions:
# required for upload-sarif action
# https://docs.github.com/en/code-security/code-scanning/integrating-with-code-scanning/uploading-a-sarif-file-to-github#example-workflow-for-sarif-files-generated-outside-of-a-repository
security-events: write
contents: read
steps:
- uses: actions/checkout@v4.2.2
- uses: astral-sh/setup-uv@v5.2.2
id: setup-uv
with:
# renovate: datasource=pypi dependency=uv
version: "0.5.25"
# ubuntu-latest already has Python 3.x installed (pip is needed by the pre-commit action)
- name: Print the installed versions
run: |
echo "Installed uv version is ${{ steps.setup-uv.outputs.uv-version }}"
echo "Installed Python version is $(python --version)"
uv python list
- uses: pre-commit/action@v3.0.1
- name: Run markdownlint
uses: YannickTeKulve/docker-run-action@0.0.6
with:
image: davidanson/markdownlint-cli2-rules:v0.17.2
# node user does not have permissions to workspace due to user id mismatch
options: -v ${{ github.workspace }}:/workdir --user root
# use the config file that is stored outside the root for CI specific configuration
# don't fail step if there are violations
run: markdownlint-cli2 --config .github/markdownlint/.markdownlint-cli2.yaml "**/*.md" || true
# Needs to be a public repo in order for uploading SARIF files to work
# https://docs.github.com/en/code-security/code-scanning/integrating-with-code-scanning/uploading-a-sarif-file-to-github
# - uses: github/codeql-action/upload-sarif@v3
# with:
# # Path to SARIF file relative to the root of the repository
# sarif_file: markdownlint-cli2-sarif.sarif
# # Optional category for the results
# # Used to differentiate multiple results for one commit
# category: markdownlint
# fail if there are markdownlint violations
- name: Check markdownlint results
run: |
cat markdownlint-cli2-sarif.sarif | grep -q '"results": \[\]'


build:
runs-on: ubuntu-latest
needs:
- lint
steps:
- uses: actions/checkout@v4.2.2
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this step have a name, like the checkout step above?

Same question for one of the other steps below that doesn't have a name.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not required, it will then say "Run actions/checkout@v4.2.2".

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I leave it up to you then.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed names where it is obvious (when reusing an action).

with:
# fetch the full git history to be able to determine creation dates for pages
# see: https://github.com/timvink/mkdocs-git-revision-date-localized-plugin?tab=readme-ov-file#note-when-using-build-environments
fetch-depth: 0
- uses: astral-sh/setup-uv@v5.2.2
id: setup-uv
with:
# renovate: datasource=pypi dependency=uv
version: "0.5.25"
python-version: 3.13
- name: Print the installed versions
run: |
echo "Installed uv version is ${{ steps.setup-uv.outputs.uv-version }}"
echo "Installed Python version is $(python --version)"
uv python list
- name: Install dependencies
run: uv pip install -r requirements.txt
- uses: actions/cache@v4.2.0
with:
# weekly cache
key: mkdocs-material-$(date --utc '+%V')
path: .cache
restore-keys: |
mkdocs-material-
- name: Build site
run: mkdocs build --strict
59 changes: 59 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: deploy

on:
workflow_run:
workflows: [ci]
branches:
- main
types:
- completed
workflow_dispatch:

concurrency:
group: deploy
cancel-in-progress: true

jobs:
deploy:
runs-on: ubuntu-latest
# only run if CI workflow completed successfully
# https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#running-a-workflow-based-on-the-conclusion-of-another-workflow
if: ${{ github.event.workflow_run.conclusion == 'success' }}
permissions:
contents: write
environment: pages
steps:
- uses: actions/checkout@v4.2.2
with:
# fetch the full git history to be able to determine creation dates for pages
# see: https://github.com/timvink/mkdocs-git-revision-date-localized-plugin?tab=readme-ov-file#note-when-using-build-environments
fetch-depth: 0
- name: Configure Git Credentials
# see: https://github.com/actions/checkout#push-a-commit-using-the-built-in-token
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@v5.2.2
id: setup-uv
with:
# renovate: datasource=pypi dependency=uv
version: "0.5.25"
python-version: 3.13
- name: Print the installed versions
run: |
echo "Installed uv version is ${{ steps.setup-uv.outputs.uv-version }}"
echo "Installed Python version is $(python --version)"
uv python list
- name: Install dependencies
run: uv pip install -r requirements.txt
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
- uses: actions/cache@v4.2.0
with:
key: mkdocs-material-${{ env.cache_id }}
path: .cache
restore-keys: |
mkdocs-material-
- name: Deploy to GitHub Pages
# see: https://squidfunk.github.io/mkdocs-material/publishing-your-site/#with-github-actions
run: mkdocs gh-deploy --strict --force
75 changes: 0 additions & 75 deletions .gitlab-ci.yml

This file was deleted.

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Opal Documentation

[![pipeline status](https://gitlab.com/opalmedapps/docs/badges/main/pipeline.svg)](https://gitlab.com/opalmedapps/docs/-/commits/main) [![Docs](https://img.shields.io/badge/docs-available-brightgreen.svg)](https://docs.opalmedapps.ca)
[![ci](https://github.com/opalmedapps/docs/actions/workflows/ci.yml/badge.svg)](https://github.com/opalmedapps/docs/actions/workflows/ci.yml) [![Docs](https://img.shields.io/badge/docs-available-brightgreen.svg)](https://docs.opalmedapps.com)

Project for the Opal documentation site.

Expand All @@ -9,7 +9,7 @@ Material for MkDocs makes use of [Python Markdown](https://python-markdown.githu

In addition, we use the [PlantUML Markdown extension](https://github.com/mikitex70/plantuml-markdown) to render [PlantUML](https://plantuml.com) diagrams.

The documentation site is deployed to GitLab Pages at https://docs.opalmedapps.ca.
The documentation site is deployed to GitHub Pages at https://docs.opalmedapps.com.

## Contributing

Expand Down
2 changes: 2 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,8 @@ validation:
unrecognized_links: warn
anchors: warn

strict: true


watch:
- CHANGELOG.md