Skip to content

Rules-Build

Rules-Build #618

Workflow file for this run

name: Rules-Build
on:
schedule:
- cron: '15 16 * * *'
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-24.04
#if: github.event.repository.owner.id == github.event.sender.id
steps:
- name: Clone Repository
uses: actions/checkout@main
- name: Show CPU Model
run: |
echo -e "Total CPU cores\t: $(nproc)"
cat /proc/cpuinfo | grep 'model name'
ulimit -a
- name: Prepared
run: |
pip3 install requests --break-system-packages
- name: Build
run: |
sudo chown -R runner:runner /home/runner/work/Rule
python3 ./run.py
export CURRENT_DATE="$(date -d "+1 day" "+%Y.%m.%d")"
echo "CURRENT_DATE=$CURRENT_DATE" >> $GITHUB_ENV
- name: Release
uses: ncipollo/[email protected]
with:
name: Rocket Release
allowUpdates: true
replacesArtifacts: true
commit: ${{ env.CURRENT_BRANCH }}
tag: ${{ env.CURRENT_DATE }}
token: ${{ secrets.GITHUB_TOKEN }}
artifacts: ./Rocket.conf
Cleanup-Old-Releases:
runs-on: ubuntu-24.04
#if: github.event.repository.owner.id == github.event.sender.id
steps:
- name: Delete Older Releases
uses: dev-drprasad/delete-older-releases@master
with:
keep_latest: 2
delete_tags: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Cleanup-Workflow-Logs:
runs-on: ubuntu-24.04
#if: github.event.repository.owner.id == github.event.sender.id
steps:
- name: Cleanup Workflow Logs
uses: Mattraks/delete-workflow-runs@main
with:
token: ${{ secrets.GITHUB_TOKEN }}
repository: ${{ github.repository }}
retain_days: 2
keep_minimum_runs: 2