Scheduled Tasks #35
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: Scheduled Tasks | |
| on: | |
| schedule: | |
| # Run daily at 2 AM UTC | |
| - cron: '0 2 * * *' | |
| workflow_dispatch: | |
| jobs: | |
| dependency-update: | |
| name: Check Dependencies | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: '9.0.x' | |
| - name: Check for outdated packages | |
| run: | | |
| echo "# Outdated Packages Report" > outdated-report.md | |
| echo "" >> outdated-report.md | |
| dotnet list auction.sln package --outdated >> outdated-report.md 2>&1 || true | |
| - name: Check for vulnerable packages | |
| run: | | |
| echo "" >> outdated-report.md | |
| echo "# Vulnerability Report" >> outdated-report.md | |
| echo "" >> outdated-report.md | |
| dotnet list auction.sln package --vulnerable --include-transitive >> outdated-report.md 2>&1 || true | |
| - name: Upload report | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: dependency-report-${{ github.run_number }} | |
| path: outdated-report.md | |
| cleanup: | |
| name: Cleanup Old Images | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| service: | |
| - identity-api | |
| - auction-api | |
| - bidding-api | |
| - payment-api | |
| - notification-api | |
| - analytics-api | |
| - search-api | |
| - storage-api | |
| - job-api | |
| - gateway-api | |
| steps: | |
| - name: Delete old container images | |
| uses: actions/delete-package-versions@v5 | |
| with: | |
| package-name: 'auction-platform/${{ matrix.service }}' | |
| package-type: 'container' | |
| min-versions-to-keep: 10 | |
| delete-only-untagged-versions: 'true' |