79 lines
1.9 KiB
YAML
79 lines
1.9 KiB
YAML
# GitHub Actions workflow for building Rocky Man pages
|
|
name: Build Rocky Man Pages
|
|
|
|
on:
|
|
|
|
# Allow manual trigger
|
|
workflow_dispatch:
|
|
inputs:
|
|
versions:
|
|
description: 'Rocky Linux versions to build (space-separated)'
|
|
required: false
|
|
default: '8.10 9.6 10.0'
|
|
|
|
|
|
# # Run on push to main (for testing)
|
|
# push:
|
|
# branches:
|
|
# - main
|
|
# paths:
|
|
# - 'src/**'
|
|
# - 'templates/**'
|
|
# - 'pyproject.toml'
|
|
# - '.github/workflows/build.yml'
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
container:
|
|
image: rockylinux:9
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Install system dependencies
|
|
run: |
|
|
dnf install -y \
|
|
python3.11 \
|
|
python3.11-pip \
|
|
mandoc \
|
|
rpm-build \
|
|
dnf-plugins-core \
|
|
git
|
|
|
|
- name: Install UV
|
|
run: |
|
|
curl -LsSf https://astral.sh/uv/install.sh | sh
|
|
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
|
|
|
|
- name: Install Python dependencies
|
|
run: |
|
|
uv pip install --system -e .
|
|
|
|
- name: Build man pages
|
|
run: |
|
|
python3.11 -m rocky_man.main \
|
|
--versions ${{ github.event.inputs.versions || '8.10 9.5' }} \
|
|
--output-dir ./html \
|
|
--download-dir ./tmp/downloads \
|
|
--extract-dir ./tmp/extracts \
|
|
--verbose
|
|
env:
|
|
PYTHONUNBUFFERED: 1
|
|
|
|
- name: Upload artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: rocky-man-pages
|
|
path: html/
|
|
retention-days: 30
|
|
|
|
- name: Deploy to GitHub Pages
|
|
if: github.ref == 'refs/heads/main'
|
|
uses: peaceiris/actions-gh-pages@v3
|
|
with:
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
publish_dir: ./html
|
|
force_orphan: true
|