Skip to content

Commit

Permalink
Deploying to main from @ KyoriPowered/adventure-docs@355b378 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
kezz committed Dec 21, 2023
0 parents commit 4ca5189
Show file tree
Hide file tree
Showing 1,542 changed files with 239,775 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/cleanup.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: "cleanup old builds"

on:
schedule:
- cron: '14 1 * * *'
workflow_dispatch:

env:
PYTHON_VERSION: "3.10"

jobs:
cleanup:
runs-on: "ubuntu-latest"
steps:
- name: "checkout"
uses: "actions/checkout@v3"
- name: "setup python ${{ env.PYTHON_VERSION }}"
uses: "actions/setup-python@v4"
with:
python-version: "${{ env.PYTHON_VERSION }}"
cache: "pip"
cache-dependency-path: "_scripts/requirements.txt"
- name: "install dependencies"
run: "pip install -r _scripts/requirements.txt"
- name: "cleanup old PRs"
run: |
git config user.name "kyori-bot"
git config user.email "[email protected]"
python _scripts/cleanup.py .
git commit -a -m 'cleanup outdated previews' || true
git push
1 change: 1 addition & 0 deletions .nojekyll
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

50 changes: 50 additions & 0 deletions _scripts/cleanup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#!/usr/bin/env python

import datetime
import dateutil.parser
import json
from pathlib import Path
import shutil


now = datetime.datetime.now(datetime.timezone.utc)
cutoff = now - datetime.timedelta(days = 90)


def stale(pull: Path) -> bool:
info_path = pull / '_preview_data.json'

try:
with info_path.open('rt') as fp:
info = json.load(fp)
except json.JSONDecodeError:
print(f"::error file={info_path.absolute}::Invalid build info for pull #{pull.name}")

pr_time = dateutil.parser.isoparse(info['time'])

return pr_time < cutoff


def cleanup(base: Path, deleted):
for pull in base.iterdir():
if pull.is_dir:
if stale(pull):
shutil.rmtree(pull)
deleted(pull)


if __name__ == "__main__":
from sys import argv
from os import environ
if len(argv) < 2:
print(f"Not enough arguments! Usage: {argv[0]} <repo>")
exit(1)

dest = Path(argv[1]) / 'pull'
if 'GITHUB_STEP_SUMMARY' in environ:
with open(environ['GITHUB_STEP_SUMMARY'], 'at') as fp:
fp.write("# Cleaned up previews\n\n")
cleanup(dest, lambda path: fp.write(f'- `#{path.name}`\n'))
else:
cleanup(dest, lambda _: None)

1 change: 1 addition & 0 deletions _scripts/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
python-dateutil
4 changes: 4 additions & 0 deletions pull/144/.buildinfo
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 759375a2c7233b3b31a695843c4cb595
tags: 645f666f9bcd5a90fca523b33c5a78b7
Binary file added pull/144/_images/click_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pull/144/_images/color_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pull/144/_images/color_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pull/144/_images/color_verbose_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pull/144/_images/color_verbose_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pull/144/_images/decoration_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pull/144/_images/font_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pull/144/_images/gradient_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pull/144/_images/hover_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pull/144/_images/insertion_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pull/144/_images/key_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pull/144/_images/newline_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pull/144/_images/rainbow_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pull/144/_images/reset_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pull/144/_images/selector_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pull/144/_images/tablist.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pull/144/_images/transition_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pull/144/_images/translatable_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pull/144/_images/translatable_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions pull/144/_preview_data.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"pr":"144","time":"2023-10-04T14:31:21.879Z"}

Large diffs are not rendered by default.

27 changes: 27 additions & 0 deletions pull/144/_sphinx_design_static/design-tabs.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
var sd_labels_by_text = {};

function ready() {
const li = document.getElementsByClassName("sd-tab-label");
for (const label of li) {
syncId = label.getAttribute("data-sync-id");
if (syncId) {
label.onclick = onLabelClick;
if (!sd_labels_by_text[syncId]) {
sd_labels_by_text[syncId] = [];
}
sd_labels_by_text[syncId].push(label);
}
}
}

function onLabelClick() {
// Activate other inputs with the same sync id.
syncId = this.getAttribute("data-sync-id");
for (label of sd_labels_by_text[syncId]) {
if (label === this) continue;
label.previousElementSibling.checked = true;
}
window.localStorage.setItem("sphinx-design-last-tab", syncId);
}

document.addEventListener("DOMContentLoaded", ready, false);
Loading

0 comments on commit 4ca5189

Please sign in to comment.