mirror of
https://github.com/89luca89/distrobox.git
synced 2026-08-19 01:14:49 -05:00
76 lines
2.2 KiB
YAML
76 lines
2.2 KiB
YAML
---
|
|
# This is a basic workflow to help you get started with Actions
|
|
|
|
name: Docs
|
|
|
|
# Controls when the workflow will run
|
|
on:
|
|
# Triggers the workflow on push or pull request events but only for the master branch
|
|
push:
|
|
branches: [main]
|
|
|
|
# Allows you to run this workflow manually from the Actions tab
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
|
|
# Check changes, cancel job is not.
|
|
check_changes:
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
distrobox_changed: ${{ steps.check_file_changed.outputs.distrobox_changed }}
|
|
steps:
|
|
|
|
- uses: actions/checkout@v6
|
|
with:
|
|
# Checkout as many commits as needed for the diff
|
|
repository: 89luca89/distrobox
|
|
ref: main
|
|
persist-credentials: false
|
|
fetch-depth: 2
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
# Fetch from compatibility table all the distros supported
|
|
- id: check_file_changed
|
|
run: |
|
|
if git diff --name-only HEAD^ HEAD | grep -E "^docs|gen-man"; then
|
|
echo "::set-output name=distrobox_changed::True"
|
|
else
|
|
echo "::set-output name=distrobox_changed::False"
|
|
fi
|
|
|
|
gen_man:
|
|
runs-on: ubuntu-latest
|
|
needs: check_changes
|
|
if: needs.check_changes.outputs.distrobox_changed == 'True'
|
|
steps:
|
|
|
|
- uses: actions/checkout@v6
|
|
with:
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
# Fetch from compatibility table all the distros supported
|
|
- id: generate
|
|
run: |
|
|
VERSION=3.6.1
|
|
RELEASE="jgm/pandoc/releases/download/${VERSION}/pandoc-${VERSION}-1-amd64.deb"
|
|
NAME=$(echo $RELEASE | rev | cut -d'/' -f1 | rev)
|
|
|
|
curl -L https://github.com/$RELEASE -o $NAME
|
|
sudo apt-get update
|
|
sudo apt-get install -y ./$NAME
|
|
sudo apt-get install -y ronn
|
|
|
|
rm -f $NAME
|
|
|
|
man/gen-man
|
|
|
|
- uses: stefanzweifel/git-auto-commit-action@v7
|
|
with:
|
|
branch: main
|
|
commit_message: Automatic Man Page Update
|
|
commit_options: '--no-verify --signoff'
|
|
commit_user_name: distrobox-docs-bot
|
|
commit_user_email: distrobox-docs-bot@users.noreply.github.com
|
|
commit_author: distrobox-docs-bot <actions@github.com>
|