Skip to content

Build docs and push to main #875

Build docs and push to main

Build docs and push to main #875

Workflow file for this run

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 "[email protected]"
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: |
mkdir temp && cd temp
git clone https://mo-auto:${{ secrets.MOAUTO_WORKFLOW_TOKEN }}@github.com/JanssenProject/jans.git
cd jans
git checkout -b docs-update-mkdocs-javadocs-links
git pull origin docs-update-mkdocs-javadocs-links || echo "Nothing to pull"
echo "Generating javadocs"
sudo bash ../../automation/docs/generate-javadocs.sh . ../../ || echo "something went wrong with generating the java docs"
cd ../../
sudo rm -rf temp
git commit -a -S -m "docs: update javadocs" || echo "Nothing to commit"
git push