Skip to content

Commit

Permalink
CI to generate documentation from supported policies
Browse files Browse the repository at this point in the history
Hook up in parallel to adm* generation, documentation generations under
docs/
  • Loading branch information
didrocks committed Nov 15, 2023
1 parent 01f7c74 commit 074258b
Showing 1 changed file with 47 additions and 3 deletions.
50 changes: 47 additions & 3 deletions .github/workflows/policy-builds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -163,10 +163,49 @@ jobs:
path: Ubuntu.adm*
if-no-files-found: error

generate-doc:
name: Merge keys to generated documentation
runs-on: ubuntu-latest
needs: collect-releases
steps:
- name: Install needed binaries
run: |
sudo apt-get update
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y distro-info
- name: Download all available artifacts
uses: actions/download-artifact@v3
with:
path: artifacts
- name: Display structure of downloaded files
run: |
set -eu
target=$(ubuntu-distro-info -r --supported | cut -d" " -f1)
mkdir wanted/
for f in $(find artifacts/policies-*/ -type f); do
for wanted in ${target}; do
if [ $(basename $f) != ${wanted}.yaml ]; then
continue
fi
cp $f wanted/
done
done
chmod +x artifacts/admxgen/admxgen
artifacts/admxgen/admxgen doc artifacts/admxgen/cmd/admxgen/defs/categories.yaml wanted/ generated-docs/
ls -R
- name: Upload adm template files
uses: actions/upload-artifact@v3
with:
name: generated-docs
path: generated-docs/*
if-no-files-found: error

integrate:
name: Integrate policy changes in current git tree
runs-on: ubuntu-latest
needs: generate-ad
needs:
- generate-ad
- generate-doc
steps:
- uses: actions/checkout@v4
- name: Download adm template files for "all"
Expand All @@ -179,9 +218,14 @@ jobs:
with:
name: adm-LTS
path: policies/Ubuntu/lts-only
- name: Copy admx and adml to git
- name: Download generated documentation
uses: actions/download-artifact@v3
with:
name: generated-docs
path: docs/reference/policies/
- name: Add generated files to git
run: |
git add policies/
git add policies/ docs/reference/policies/
- name: Get output branch for branch name
id: get-branch-name
shell: bash
Expand Down

0 comments on commit 074258b

Please sign in to comment.