diff --git a/.github/workflows/automation.yml b/.github/workflows/automation.yml index 2952fe0..8132751 100644 --- a/.github/workflows/automation.yml +++ b/.github/workflows/automation.yml @@ -2,7 +2,7 @@ name: Update download counts on: schedule: - - cron: '0 0 * * *' # Runs at 00:00 UTC every day + - cron: '0 0,8,16 * * *' # Run every 8 hours workflow_dispatch: # Allows manual triggering jobs: @@ -10,6 +10,7 @@ jobs: runs-on: ubuntu-latest env: GIT_TOKEN: ${{ secrets.GIT_TOKEN }} + REPO_FULL: ${{ github.repository }} steps: - name: Restore cached binary @@ -39,7 +40,7 @@ jobs: if: ${{ !steps.cache.outputs.cache-hit || steps.check_ver.outputs.exit_code == '70' }} continue-on-error: true run: | - wget "https://drive.google.com/uc?export=download&id=1yHF8B0YynKglsOOsGAb5VXzOCAsCKW5o" -O ./nexus-mods.gz + wget "https://github.com/WardLordRuby/nexus_badges/releases/latest/download/nexus_badges_linux_amd64.gz" -O ./nexus-mods.gz echo "cache_key_new=${{ runner.os }}-binary-nexus-badges-${{ github.run_id }}-${{ github.run_attempt }}" >> $GITHUB_OUTPUT - name: Cache latest binary @@ -57,17 +58,13 @@ jobs: chmod +x ./nexus-mods - name: Set cache key - if: ${{ !steps.cache.outputs.cache-hit && steps.cache_latest.outcome == 'success' }} + if: ${{ steps.cache_latest.outcome == 'success' && !steps.cache.outputs.cache-hit }} continue-on-error: true - env: - REPO_FULL: ${{ github.repository }} run: ./nexus-mods --remote update-cache-key --new ${{ steps.download_latest.outputs.cache_key_new }} - name: Remove old cache & update cache key - if: ${{ steps.cache.outputs.cache-hit && steps.cache_latest.outcome == 'success' }} + if: ${{ steps.cache_latest.outcome == 'success' && steps.cache.outputs.cache-hit }} continue-on-error: true - env: - REPO_FULL: ${{ github.repository }} run: ./nexus-mods --remote update-cache-key --old ${{ vars.CACHED_BIN }} --new ${{ steps.download_latest.outputs.cache_key_new }} - name: Run binary