moderncv/.github/workflows/build-userguide-pdf.yml
daniel a1aac59a6f
Fix auto guide generation on master (#284)
* prevent warning on user guide creation: current user from gh actions vs. owner: detected dubious ownership in repository at '/__w/moderncv/moderncv'

* manipulate conditions for tests besides the master branch!

* add debug output lines

* <automated> build of user guide

* revert debug outputs and manipulation of branches for tests

* Revert "<automated> build of user guide"

This reverts commit 0da41eb48a.
2026-05-25 23:04:48 +02:00

57 lines
1.7 KiB
YAML

name: Build user guide
on:
push:
branches:
- master
paths:
- 'manual/moderncv_userguide.tex'
pull_request:
paths:
- 'manual/moderncv_userguide.tex'
jobs:
build-userguide:
name: Build user guide
runs-on: ubuntu-latest
env:
UG_AUTHOR: Auto Userguide Creator
UG_COMMIT_MESSAGE: <automated> build of user guide
container:
image: texlive/texlive:latest-full
steps:
- name: Checkout source code
uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Build user guide pdf
run: latexmk -pdflua -cd ./manual/moderncv_userguide.tex
- name: Upload user guide pdf
uses: actions/upload-artifact@v4
with:
name: moderncv_userguide.pdf
path: ./manual/moderncv_userguide.pdf
- name: Upload user guide log
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: moderncv_userguide.log
path: ./manual/moderncv_userguide.log
- name: Push new user guide to master
if: ${{ github.ref_name == 'master' }}
run: |
# maybe switch to an image with git already included, for now install it here
apt update && apt install git -y
git config --global user.name '${{ env.UG_AUTHOR }}'
git config --global user.email '${{ github.actor }}@users.noreply.github.com'
# prevent error message due to mismatch in users: process in gh actions vs. owner of repo
git config --global --add safe.directory /__w/moderncv/moderncv
ls -l
git add manual/moderncv_userguide.pdf
git commit -m "${{ env.UG_COMMIT_MESSAGE }}"
git push