Build docs and push to main #1071
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build docs and push to main | |
on: | |
schedule: | |
- cron: "0 23 * * *" | |
workflow_dispatch: | |
concurrency: | |
group: run-once | |
cancel-in-progress: false | |
permissions: | |
contents: read | |
jobs: | |
build: | |
permissions: | |
contents: write # for Git to git push | |
if: github.repository_owner == 'JanssenProject' | |
name: generate docs | |
runs-on: ubuntu-latest | |
steps: | |
- name: Harden Runner | |
uses: step-security/harden-runner@eb238b55efaa70779f274895e782ed17c84f2895 # v2.6.1 | |
with: | |
egress-policy: audit | |
- name: Checkout | |
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
with: | |
fetch-depth: 0 | |
token: ${{ secrets.MOAUTO_WORKFLOW_TOKEN }} | |
- uses: actions/setup-java@v4 | |
with: | |
distribution: 'corretto' | |
java-version: '17' | |
- name: Import GPG key | |
id: import_gpg | |
uses: crazy-max/ghaction-import-gpg@01dd5d3ca463c7f10f7f4f7b4f177225ac661ee4 # v6.1.0 | |
with: | |
gpg_private_key: ${{ secrets.MOAUTO_GPG_PRIVATE_KEY }} | |
passphrase: ${{ secrets.MOAUTO_GPG_PRIVATE_KEY_PASSPHRASE }} | |
git_user_signingkey: true | |
git_commit_gpgsign: true | |
- name: Configure Git | |
run: | | |
git config --global user.name "mo-auto" | |
git config --global user.email "54212639+mo-auto@users.noreply.github.com" | |
git config --global user.signingkey "${{ steps.import_gpg.outputs.keyid }}" | |
echo "${{ secrets.MOAUTO_WORKFLOW_TOKEN }}" | gh auth login --with-token | |
- name: Generate docs | |
continue-on-error: true | |
run: | | |
rustup update stable && rustup default stable | |
mkdir temp && cd temp | |
git clone https://mo-auto:${{ secrets.MOAUTO_WORKFLOW_TOKEN }}@github.com/JanssenProject/jans.git | |
cd jans | |
echo "Generating javadocs" | |
sudo bash ../../automation/docs/generate-javadocs.sh . ../../ || echo "something went wrong with generating the java docs" | |
echo "Generating Rust docs" | |
bash ../../automation/docs/generate-rustdocs.sh || echo "something went wrong with generating the rust docs" | |
cp -rv jans-cedarling/target/doc ../../cedarling | |
echo "Generating Python docs" | |
python -m venv venv | |
source venv/bin/activate | |
pip install maturin[patchelf] | |
cd jans-cedarling/bindings/cedarling_python | |
maturin develop --release | |
python -m pydoc -w cedarling_python || echo "something went wrong with generating the python docs" | |
cp -rv cedarling_python.html ../../../../../cedarling-python/cedarling_python.html | |
cd ../../../../../ | |
sudo rm -rf temp | |
git add . || echo "Nothing to add" | |
git commit -a -S -m "docs: update javadocs & rustdocs" || echo "Nothing to commit" | |
git push | |