mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2026-01-22 05:54:29 +01:00
89 lines
2.4 KiB
YAML
89 lines
2.4 KiB
YAML
name: Build and upload Documentation
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
push: # Only for Testing change later
|
|
|
|
|
|
env:
|
|
BUILD_TYPE: RELEASE
|
|
|
|
permissions:
|
|
contents: read
|
|
pages: write
|
|
id-token: write
|
|
|
|
jobs:
|
|
build-and-deploy:
|
|
strategy:
|
|
matrix:
|
|
patform: [ubuntu-latest]
|
|
python-version: ["3.12"]
|
|
runs-on: ${{ matrix.patform }}
|
|
|
|
defaults:
|
|
run:
|
|
shell: "bash -l {0}"
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Install System Packages
|
|
uses: awalsh128/cache-apt-pkgs-action@latest
|
|
with:
|
|
packages: libhdf5-dev doxygen
|
|
version: 1.0
|
|
|
|
- name: Setup Python
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: 3.12
|
|
cache: 'pip'
|
|
- name: Install Python Packages
|
|
run: pip install sphinx sphinx_rtd_theme breathe
|
|
|
|
|
|
- name: Build Documentation
|
|
run: |
|
|
mkdir build
|
|
cd build
|
|
cmake -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DSLS_BUILD_DOCS=ON -DSLS_USE_HDF5=ON -DSLS_USE_PYTHON=ON ..
|
|
make -j4
|
|
make docs
|
|
|
|
- name: Upload Documentation Artifact
|
|
uses: actions/upload-pages-artifact@v4
|
|
with:
|
|
path: build/docs/html # maybe we need to upload images as well - so one can click on them?
|
|
|
|
- name: Checkout gh-pages
|
|
uses: actions/checkout@v4
|
|
with:
|
|
ref: gh-pages
|
|
path: gh-pages
|
|
|
|
- name: Copy documentation to gh-pages # create folder structure
|
|
run: cp -r build/docs/html/. gh-pages/
|
|
|
|
- name: Commit and Push changes to gh-pages
|
|
run: |
|
|
cd gh-pages
|
|
git config --global user.name 'github-actions'
|
|
git config --global user.email 'github-actions@github.com'
|
|
git add .
|
|
git commit -m "Update Documentation"
|
|
git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git
|
|
git push origin gh-pages
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|