Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 16 additions & 18 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,33 +68,30 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
with:
path: ./current
- name: Checkout gh-pages branch
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
with:
ref: gh-pages
path: ./docs
- name: Setup doxygen
run: sudo apt-get install doxygen graphviz
- name: Create temporary directory
- name: Setup environment
run: |
tmpdir=$(mktemp -d -p "$GITHUB_WORKSPACE")
mkdir -p $tmpdir
relative_path=$(realpath --relative-to="$GITHUB_WORKSPACE" "$tmpdir")
echo "Created temporary directory $tmpdir ($relative_path relative to $GITHUB_WORKSPACE)"
echo "DOCS_REPOSITORY_DIR=$relative_path" >> "$GITHUB_ENV"
if [[ "$GITHUB_REF" =~ ^"refs/tags/"[0-9]+.[0-9]+.[0-9]+$ ]]; then
echo "DOCS_TEMP_DIR_SUBPATH=stable" >> "$GITHUB_ENV"
docs_subpath="stable"
else
if [[ "$GITHUB_REF" =~ ^"refs/tags/"[0-9]+.[0-9]+.[0-9]+-[a-z]+.[0-9]+$ ]]; then
echo "DOCS_TEMP_DIR_SUBPATH=preview" >> "$GITHUB_ENV"
docs_subpath="preview"
else
echo "DOCS_TEMP_DIR_SUBPATH=latest" >> "$GITHUB_ENV"
docs_subpath="latest"
fi
fi
echo "DOCS_OUTPUT_DIR=$tmpdir/$DOCS_TEMP_DIR_SUBPATH" >> "$GITHUB_ENV"

- name: Checkout gh-pages branch
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
with:
ref: gh-pages
path: ${{ env.DOCS_REPOSITORY_DIR }}
echo "DOCS_TEMP_DIR_SUBPATH=$docs_subpath" >> "$GITHUB_ENV"
echo "DOCS_OUTPUT_DIR=$GITHUB_WORKSPACE/docs/$docs_subpath" >> "$GITHUB_ENV"
- name: Generate documentation
working-directory: ./documentation
working-directory: ./current/documentation
run: |
set -eo pipefail
rm -rf "${{ env.DOCS_OUTPUT_DIR }}"
Expand All @@ -109,7 +106,7 @@ jobs:
fi
- name: Commit and push changes
if: env.CREATE_RELEASE == 'true'
working-directory: ${{ env.DOCS_REPOSITORY_DIR }}
working-directory: ./docs
run: |
git config --global user.name "GitHub Actions"
git config --global user.email "publish-docs@github.com"
Expand All @@ -122,6 +119,7 @@ jobs:
fi
- name: Update readthedocs preview
if: env.CREATE_RELEASE == 'true' && env.DOCS_TEMP_DIR_SUBPATH == 'preview'
working-directory: ./docs
run: |
git fetch origin preview
git checkout preview
Expand Down