From 516d755b018b7e29356b0685cd53e2def6e12d9a Mon Sep 17 00:00:00 2001 From: debian Date: Sun, 21 Sep 2025 16:37:14 +0200 Subject: [PATCH 1/2] add mkdocs post-deploy test --- .github/scripts/mkdocs_check.py | 34 +++++++++++++++++++++++++++++++++ .github/workflows/mkdocs.yml | 16 ++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 .github/scripts/mkdocs_check.py diff --git a/.github/scripts/mkdocs_check.py b/.github/scripts/mkdocs_check.py new file mode 100644 index 00000000..b73ea26a --- /dev/null +++ b/.github/scripts/mkdocs_check.py @@ -0,0 +1,34 @@ +from selenium import webdriver +from selenium.webdriver.common.by import By +from selenium.webdriver.support.ui import WebDriverWait +from selenium.webdriver.support import expected_conditions as EC +import requests + +# Set up the Chrome WebDriver +options = webdriver.ChromeOptions() +options.add_argument('--headless') +options.add_argument('--no-sandbox') +options.add_argument('--disable-dev-shm-usage') + + +url = 'https://trapexit.github.io/mergerfs' +print(f"*** Checking {url} ***") + +driver = webdriver.Chrome(options=options) +driver.get(url) +request = requests.get(url) +print(f"INFO: Page returned HTTP {request.status_code}") +request.raise_for_status() + +# Wait for the page to load body +WebDriverWait(driver, 10).until( + EC.presence_of_element_located((By.TAG_NAME, "body")) +) + +# Get the fully rendered page source +page_source = driver.page_source +driver.quit() + +if "

404 - Not found

" in page_source: + print("ERROR: Page contains mkdocs error: '404 - Not found'") + exit(1) \ No newline at end of file diff --git a/.github/workflows/mkdocs.yml b/.github/workflows/mkdocs.yml index dd00c489..a9f67549 100644 --- a/.github/workflows/mkdocs.yml +++ b/.github/workflows/mkdocs.yml @@ -47,3 +47,19 @@ jobs: #git checkout gh-pages #git push -f origin gh-pages fi + check: + needs: deploy + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Configure Git Credentials + run: | + git config user.name github-actions[bot] + git config user.email 41898282+github-actions[bot]@users.noreply.github.com + - uses: actions/setup-python@v5 + with: + python-version: 3.x + - name: Install dependencies + run: pip install selenium requests + - name: Run mkdocs_check.py + run: python .github/scripts/mkdocs_check.py \ No newline at end of file From be80be43c071ba2ed6f2ba1bbbefedd1078a2349 Mon Sep 17 00:00:00 2001 From: debian Date: Sun, 21 Sep 2025 16:41:29 +0200 Subject: [PATCH 2/2] force pipeline --- .github/scripts/mkdocs_check.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/scripts/mkdocs_check.py b/.github/scripts/mkdocs_check.py index b73ea26a..d98a7873 100644 --- a/.github/scripts/mkdocs_check.py +++ b/.github/scripts/mkdocs_check.py @@ -20,7 +20,7 @@ request = requests.get(url) print(f"INFO: Page returned HTTP {request.status_code}") request.raise_for_status() -# Wait for the page to load body +# Wait for the page to load element WebDriverWait(driver, 10).until( EC.presence_of_element_located((By.TAG_NAME, "body")) )