Skip to content

Documentation Auto Refresh #50

Documentation Auto Refresh

Documentation Auto Refresh #50

#
# This workflow compile and send analysis to sonarcloud
# + generate documentation and commit it to the wiki repository
# + trigger GHA on website's repository
#
name: "Documentation Auto Refresh"
on:
workflow_dispatch: # For manual trigger
schedule:
- cron: "0 0 * * 6"
jobs:
generating-documentation:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Adopt OpenJDK
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
java-package: jdk
- name: Set custom runner parameters
run: |
echo "MAVEN_OPTS='-Xmx15g'" >> ~/.mavenrc
- name: Update Maven to 3.9.X
run: |
# Needed for Tycho 4.X.X and support for JDK 21
wget https://dlcdn.apache.org/maven/maven-3/3.9.7/binaries/apache-maven-3.9.7-bin.tar.gz
tar -xvf apache-maven-3.9.7-bin.tar.gz
mv apache-maven-3.9.7 /opt/
M2_HOME='/opt/apache-maven-3.9.7'
PATH="$M2_HOME/bin:$PATH"
export PATH
# Overwrite PATH with updated maven install
echo $PATH > $GITHUB_PATH
echo "=== Check if well installed ==="
echo "$ mvn -version"
mvn -version
- name: Compiling GAMA
run: bash travis/build.sh -B -T 4
- name: Generate documentation
run: |
git clone --depth 1 https://github.com/gama-platform/gama.wiki.git $GITHUB_WORKSPACE/../gama.wiki
cd $GITHUB_WORKSPACE/gama.documentation/
java -cp ".:libs/jdom-2.0.1.jar:target/classes:../gama.annotations/target/classes" gama.documentation.MainGenerateWiki -online
- name: Commit updated documentation files
run: |
git config --global user.email "[email protected]"
git config --global user.name "GAMA Bot"
cd $GITHUB_WORKSPACE/../gama.wiki
git remote set-url origin https://gama-bot:[email protected]/gama-platform/gama.wiki.git
git status
git add -A
git commit -m "Regenerate operators artifacts on wiki - $(date)"
git push
env:
BOT_TOKEN: ${{ secrets.BOT_TOKEN }}
- name: Trigger documentation website rebuild
run: |
curl --request POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: token ${{ secrets.BOT_TOKEN }}" \
--data '{"event_type": "automated-generation"}' \
https://api.github.com/repos/gama-platform/gama-platform.github.io/dispatches