diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml new file mode 100644 index 0000000..64fe7d2 --- /dev/null +++ b/.gitea/workflows/deploy.yml @@ -0,0 +1,33 @@ +--- +name: Build and deploy documentation +on: + push: + branches: + - main + workflow_dispatch: +jobs: + build-and-deploy-docs: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Configure git credentials + run: | + git config --global user.name "Gitea Actions" + git config --global user.email "actions@gitea.local" + - uses: actions/setup-python@v5 + with: + python-version: "3" + - name: Install mkdocs-material + run: pip install mkdocs-material=="9.*" + - name: Build documentation + run: mkdocs build + - name: Deploy documentation + # the default mkdocs build output directory `/site` is gitignored + # so it's safe to `git rm -rf .` + run: | + git checkout --orphan gitea-pages + git rm -rf . + cp -r site/* . + git add . + git commit -m "Deploy documentation" + git push --force origin gitea-pages diff --git a/.gitea/workflows/md.yml b/.gitea/workflows/md.yml new file mode 100644 index 0000000..d1521e8 --- /dev/null +++ b/.gitea/workflows/md.yml @@ -0,0 +1,11 @@ +--- +name: Lint markdown files +on: [pull_request] # yamllint disable-line rule:truthy +jobs: + run-markdownlint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: https://github.com/DavidAnson/markdownlint-cli2-action@v20 + with: + globs: "**/*.md" diff --git a/compose.yml b/compose.yml new file mode 100644 index 0000000..894f078 --- /dev/null +++ b/compose.yml @@ -0,0 +1,12 @@ +--- +services: + mkdocs: + image: docker.io/squidfunk/mkdocs-material:9 + security_opt: + - no-new-privileges:true + volumes: + - ./:/docs + ports: + - 8000:8000 + healthcheck: + test: wget --spider --quiet http://127.0.0.1:8000 diff --git a/docs/hello-world.md b/docs/hello-world.md new file mode 100644 index 0000000..5a71ccb --- /dev/null +++ b/docs/hello-world.md @@ -0,0 +1,13 @@ +# Hello World! 👋 + +*Knock knock.* +"Who's there?" +"World." +"World who?" +"World you like to say hello back?" + +## Fun Fact +This page has achieved more in 10 seconds than I have all morning. + +--- +*PS: If you're reading this, you've successfully discovered the most important page on the internet. Congratulations! 🎉* diff --git a/mkdocs.yml b/mkdocs.yml new file mode 100644 index 0000000..b351b08 --- /dev/null +++ b/mkdocs.yml @@ -0,0 +1,33 @@ +# Project information +site_name: PSI Data Catalog Documentation +site_url: https://data-catalog-services.pages.psi.ch + +# Repository +repo_name: data-catalog-services/gitea-pages +repo_url: https://gitea.psi.ch/data-catalog-services/gitea-pages + +# Copyright +copyright: Copyright © 2025 Paul Scherrer Institute + +# Configuration +theme: + name: material + palette: + - media: "(prefers-color-scheme)" + toggle: + icon: material/link + name: Switch to light mode + - media: "(prefers-color-scheme: light)" + scheme: default + primary: teal + accent: teal + toggle: + icon: material/toggle-switch + name: Switch to dark mode + - media: "(prefers-color-scheme: dark)" + scheme: slate + primary: teal + accent: teal + toggle: + icon: material/toggle-switch-off + name: Switch to system preference