Skip to content

Commit

Permalink
- Add XML field explanations (#9)
Browse files Browse the repository at this point in the history
- Replace deprecated lightgallery with drop-in `glightbox` replacement (g-provost/lightgallery-markdown#15 (comment))

- Fix CI, linting

---------

Co-authored-by: Roxedus <[email protected]>
  • Loading branch information
nwithan8 and Roxedus authored Mar 25, 2024
1 parent c68ff5c commit 509d7f6
Show file tree
Hide file tree
Showing 17 changed files with 404 additions and 186 deletions.
108 changes: 62 additions & 46 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,61 +4,77 @@ on: [push, pull_request]

jobs:

markdownlint:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: markdownlint
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.x
- name: Install linters
run: |
echo '{"default": true,"line_length": false,"no-inline-html": false,"first-line-h1": false, "code-block-style": false, "ul-indent": false}' > .markdownlint.json
while IFS= read -r line; do echo "Linting ${line}"; docker run --rm -v "${PWD}:/markdown" -v "${PWD}:${PWD}" 06kellyjac/markdownlint-cli "${PWD}/${line}" || exit 1; done < <(git ls-files '*.md')
pip install $(grep yamllint requirements.txt)
- name: Lint YAML files
run: yamllint .
- name: Lint Markdown files
uses: DavidAnson/markdownlint-cli2-action@v15
with:
globs: "**/*.md"

yamllint:
build:
needs: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: yamllint
run: |
while IFS= read -r line; do echo "Linting ${line}"; docker run --rm -v "${PWD}:${PWD}" sdesbure/yamllint yamllint -d '{extends: default, rules: {document-start: {present: false}, line-length: disable}}' "${PWD}/${line}" || exit 1; done < <(git ls-files '*.yaml' '*.yml')
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup python
uses: actions/[email protected]
with:
python-version: 3.x
- name: Install dependencies
run: pip install -r requirements.txt
- name: Build documentation
run: mkdocs build

deploy:
needs: [markdownlint, yamllint]
if: github.event_name == 'push' && contains(fromJson('["refs/heads/master", "refs/heads/main"]'), github.ref)
needs: build
name: Deploy docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: mkdocs
run: |
docker run --name="patch" --entrypoint="" squidfunk/mkdocs-material pip install mkdocs-git-revision-date-localized-plugin git+git://github.com/g-provost/lightgallery-markdown#egg=lightgallery
docker commit --change 'ENTRYPOINT ["mkdocs"]' patch selfhosters/builder
docker run --rm -v ${PWD}/site:/site -v ${PWD}:/docs selfhosters/builder build --verbose --clean --strict
sudo cp ${PWD}/CNAME ${PWD}/site/
- name: deploy
if: github.ref == 'refs/heads/master'
uses: peaceiris/[email protected]
env:
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
# PERSONAL_TOKEN: ${{ secrets.PERSONAL_TOKEN }}
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PUBLISH_BRANCH: gh-pages
PUBLISH_DIR: ./site
- name: Checkout repository
uses: actions/checkout@v4
with:
emptyCommits: "false"

make_public:
needs: deploy
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master'
steps:
- name: clear CF cache
run: |
curl -X GET "https://api.cloudflare.com/client/v4/user/tokens/verify" \
-H "Authorization: Bearer ${{ secrets.CLOUDFLARE_CLEAR_CACHE }}" \
-H "Content-Type:application/json"
- name: notify discord
uses: appleboy/discord-action@master
fetch-depth: 0
sparse-checkout: |
docs
- name: Setup python
uses: actions/[email protected]
with:
webhook_id: ${{ secrets.WEBHOOK_ID }}
webhook_token: ${{ secrets.WEBHOOK_TOKEN }}
username: "Selfhosters.net"
avatar_url: "https://avatars3.githubusercontent.com/u/52747488?s=200"
message: "New stuff has been added to the wiki"
python-version: 3.x
- name: Install dependencies
run: pip install -r requirements.txt
- name: Deploy to GitHub Pages
run: mkdocs gh-deploy --force

# make_public:
# needs: builds
# runs-on: ubuntu-latest
# if: github.ref == 'refs/heads/master'
# steps:
# - name: clear CF cache
# run: |
# curl -X GET "https://api.cloudflare.com/client/v4/user/tokens/verify" \
# -H "Authorization: Bearer ${{ secrets.CLOUDFLARE_CLEAR_CACHE }}" \
# -H "Content-Type:application/json"
# - name: notify discord
# uses: appleboy/discord-action@master
# with:
# webhook_id: ${{ secrets.WEBHOOK_ID }}
# webhook_token: ${{ secrets.WEBHOOK_TOKEN }}
# username: "Selfhosters.net"
# avatar_url: "https://avatars3.githubusercontent.com/u/52747488?s=200"
# message: "New stuff has been added to the wiki"
8 changes: 8 additions & 0 deletions .markdownlint-cli2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
config:
MD007:
indent: 4
line-length: false
no-inline-html: false
code-block-style: false
ignores:
- venv/**
15 changes: 15 additions & 0 deletions .yamllint
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
extends: default

ignore: |
venv/

rules:
document-start: disable
truthy: disable
comments:
min-spaces-from-content: 1
quoted-strings:
quote-type: double
required: only-when-needed
line-length:
max: 160
2 changes: 1 addition & 1 deletion docs/commands.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

# Nice to know Unraid commands
# Nice-to-know Unraid commands

## Docker service

Expand Down
Loading

0 comments on commit 509d7f6

Please sign in to comment.