Skip to content

Generate static site #1148

Generate static site

Generate static site #1148

Workflow file for this run

name: Generate static site
on:
workflow_dispatch:
push:
branches:
- main
schedule:
- cron: '0 7 * * *'
concurrency:
group: generate-static-site
cancel-in-progress: true
jobs:
run:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
with:
path: main
- name: Checkout winsiderss/systeminformer
uses: actions/checkout@v6
with:
repository: winsiderss/systeminformer
path: systeminformer
fetch-depth: 0
sparse-checkout: |
phnt/include
- name: Checkout m417z/windows-docs-scraper
uses: actions/checkout@v6
with:
repository: m417z/windows-docs-scraper
ref: gh-pages
path: windows-docs
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3.x'
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install -r main/requirements.txt
- name: Generate docs
run: |
commit=$(git -C systeminformer rev-list HEAD -- phnt/include | head -n 1)
cd main
python -u generate_docs.py \
--path ../systeminformer/phnt/include \
--commit $commit \
--windows-docs-path ../windows-docs
- name: Deploy
run: |
git clone --depth 1 --single-branch --branch gh-pages https://x-access-token:${{ github.token }}@github.com/${{ github.repository }}.git gh-pages
cd gh-pages
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'
git rm -rf .
cp -r ../main/docs/. .
touch .nojekyll
git add -A
git diff --cached --quiet || git commit -m "deploy: $(git -C ../main rev-parse HEAD)"
git push origin gh-pages