Skip to content

Merge pull request #83 from RedHatSatellite/rel420 #63

Merge pull request #83 from RedHatSatellite/rel420

Merge pull request #83 from RedHatSatellite/rel420 #63

Workflow file for this run

name: docs
on:
push:
tags:
- "[0-9]+.[0-9]+.[0-9]+"
branches:
- develop
concurrency:
group: ${{ github.ref_name }}-${{ github.workflow }}
cancel-in-progress: true
jobs:
docs:
runs-on: ubuntu-latest
if: github.repository == 'RedHatSatellite/satellite-ansible-collection'
steps:
- uses: actions/checkout@v4
- name: configure git
run: |
git config user.name "${GITHUB_ACTOR}"
git config user.email "${GITHUB_ACTOR}@bots.github.com"
git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/*
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install dependencies
run: make doc-setup
- name: Generate changelog
run: |
git checkout -b develop-release-prep
antsibull-changelog release
git commit -m "update changelog" CHANGELOG.rst changelogs/changelog.yaml || true
if: github.ref_name == 'develop'
- name: Build docs
run: make doc
- name: commit docs
run: |
git checkout gh-pages
rm -rf $(basename ${GITHUB_REF})
mv docs/_build/html $(basename ${GITHUB_REF})
ln --force --no-dereference --symbolic $(dirname *.*.*/index.html | sort --version-sort --reverse | head -n1) latest
git show origin/develop:docs/_gh_include/header.inc > index.html
(echo develop; echo latest; dirname *.*.*/index.html | sort --version-sort --reverse) | xargs -I@@ -n1 echo '<div class="col-md-4 center"><a href="@@/" class="btn-doc btn"><i class="fa fa-newspaper-o"></i><p>@@</p></a></div>' >> index.html
git show origin/develop:docs/_gh_include/footer.inc >> index.html
git add $(basename ${GITHUB_REF}) latest index.html
git commit -m "update docs for $(basename ${GITHUB_REF})" || true
- name: push docs
run: git push origin gh-pages