Skip to content

Generate Documentation (Docker, Stretch, Qt5.7) #1

Generate Documentation (Docker, Stretch, Qt5.7)

Generate Documentation (Docker, Stretch, Qt5.7) #1

name: Generate Documentation (Docker, Stretch, Qt5.7)
on:
# Runs on pushes targeting the documentation branch
push:
branches: ["documentation"]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# cancel in-progress runs
concurrency:
group: "gendoc"
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
env:
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 3
#DOC_SOURCE_BRANCH: "master"
#DOC_TARGET_BRANCH: "gh-pages"
DOC_SOURCE_BRANCH: "documentation"
DOC_TARGET_BRANCH: "docs-generated"
DOC_TARGET_DIR: "doctarget"
DEBIAN_RELEASE: "stretch"
steps:
- name: Checkout Source
uses: actions/checkout@v3
with:
ref: ${{ env.DOC_SOURCE_BRANCH }}
- name: Build Docs
run: |
docker run --rm --privileged -v $PWD:/share debian:$DEBIAN_RELEASE-slim /bin/bash -c "
rm -f /etc/apt/sources.list;
echo 'deb http://archive.debian.org/debian $DEBIAN_RELEASE main' >> /etc/apt/sources.list;
echo 'deb http://archive.debian.org/debian $DEBIAN_RELEASE-backports main' >> /etc/apt/sources.list;
apt-get --allow-unauthenticated --no-install-recommends -qq update;
apt-get --allow-unauthenticated --no-install-recommends -qq install ca-certificates; # installed SSL certs are too old for github
apt-get --allow-unauthenticated --no-install-recommends -qq install git-core; # equivalent to git in stretch and higher
apt-get --allow-unauthenticated --no-install-recommends -qq install qttools5-dev-tools; # for qdoc
apt-get --allow-unauthenticated --no-install-recommends -qq install qtbase5-dev; # for the qdoc config stuff
export QT_SELECT=qt5; # $DEBIAN_RELEASE has qt4 and qt5
qdoc --version;
mkdir -p build ;
cd build ;
cp -r /share/* . ;
mkdir -p doc/generated;
git clone --depth 1 -b upgrade-4.5.0 https://github.com/sailfishos/sailfish-qdoc-template doc/qdoc/sailfish-qdoc-template;
/bin/bash -c ./makedocs;
mkdir /share/out;
cp -rv doc/generated/* /share/out/;
"
- name: Checkout Target
uses: actions/checkout@v3
with:
# only check out the target path:
sparse-checkout: doc
ref: ${{ env.DOC_TARGET_BRANCH }}
path: ${{ env.DOC_TARGET_DIR }}
- name: Copy Docs
run: |
rm -rf $GITHUB_WORKSPACE/$DOC_TARGET_DIR/doc/generated/*
cp -rv out/* $GITHUB_WORKSPACE/$DOC_TARGET_DIR/doc/generated/
# Add and commit the results to the target branch
- name: Add and Commit
uses: EndBug/add-and-commit@v9
with:
cwd: ${{ env.DOC_TARGET_DIR }}
add: '-A doc/generated'
author_name: 'Github Action Runner'
author_email: 'noreply@github.com'
fetch: false
message: "[Actions] Generated Documentation for ${{ github.ref_name }}"