Generate Grand Report #408
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
| # This is a basic workflow to help you get started with Actions | |
| name: Generate Grand Report | |
| # Controls when the workflow will run | |
| on: | |
| # Triggers the workflow on push or pull request events but only for the "main" branch | |
| # push: | |
| # branches: [ "main" ] | |
| # pull_request: | |
| # branches: [ "main" ] | |
| # Allows you to run this workflow manually from the Actions tab | |
| workflow_dispatch: | |
| # note - time in UTC | |
| schedule: | |
| - cron: "25 3 * * *" | |
| # todo: apply new java code in the github actions | |
| permissions: | |
| contents: write | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up JDK 24 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '24' | |
| distribution: 'temurin' | |
| server-id: github # Value of the distributionManagement/repository/id field of the pom.xml | |
| settings-path: ${{ github.workspace }} # location for the settings.xml file | |
| - name: Prepare settings.xml to use github registry | |
| uses: s4u/maven-settings-action@v4.0.0 | |
| - name: Build with Maven | |
| run: | | |
| CURRENT_DIR=$(pwd) | |
| echo "Git clone directory is ${CURRENT_DIR}" | |
| mvn -B package --file pom.xml | |
| mkdir -p /tmp/WORKDIR | |
| cp ./target/ostm.jar /tmp/WORKDIR/ostm.jar | |
| - name: Download all repositories | |
| run: | | |
| mkdir -p /tmp/WORKDIR/ALL_REPOSITORIES | |
| cp ./clone_all.sh /tmp/WORKDIR/ALL_REPOSITORIES/clone_all.sh | |
| cp ./clone_or_pull.sh /tmp/WORKDIR/ALL_REPOSITORIES/clone_or_pull.sh | |
| chmod +x /tmp/WORKDIR/ALL_REPOSITORIES/clone_all.sh | |
| chmod +x /tmp/WORKDIR/ALL_REPOSITORIES/clone_or_pull.sh | |
| cd /tmp/WORKDIR/ALL_REPOSITORIES/ | |
| ./clone_all.sh | |
| - name: Run reports | |
| run: | | |
| CURRENT_DIR=$(pwd) | |
| echo "Current directory is ${CURRENT_DIR}" | |
| cd /tmp/WORKDIR | |
| curl -o dictionary-latest-downloaded.encrypted https://raw.githubusercontent.com/exadmin/CyberFerretDictionary/main/dictionary-latest.encrypted | |
| java -jar ostm.jar ${{secrets.OSTM_TOKEN}} /tmp/WORKDIR/ALL_REPOSITORIES ./data.json ./cache /tmp/WORKDIR/dictionary-latest-downloaded.encrypted ${{secrets.OSTM_PASSWORD}} ${{secrets.OSTM_SALT}} ${CURRENT_DIR}/docs/data/grand-report-overrides.json | |
| cp ./data.json ${CURRENT_DIR}/docs/data/data.json | |
| cd ${CURRENT_DIR} | |
| cp -f ./docs/index_template.html ./docs/index.html | |
| sed -i "s/{{DATE}}/$(date)/g" ./docs/index.html | |
| git config user.name github-actions | |
| git config user.email github-actions@github.com | |
| git add ./docs/data/data.json | |
| git add ./docs/index.html | |
| git commit -m "Grand Report generation at $(date)" | |
| git push |