diff --git a/.github/workflows/.update_android_data.yml.swp b/.github/workflows/.update_android_data.yml.swp new file mode 100644 index 0000000..fb98c6f Binary files /dev/null and b/.github/workflows/.update_android_data.yml.swp differ diff --git a/.github/workflows/.update_js_metrics.yml.swp b/.github/workflows/.update_js_metrics.yml.swp new file mode 100644 index 0000000..0359af7 Binary files /dev/null and b/.github/workflows/.update_js_metrics.yml.swp differ diff --git a/.github/workflows/update_android_data.yml b/.github/workflows/update_android_data.yml new file mode 100644 index 0000000..6335fb5 --- /dev/null +++ b/.github/workflows/update_android_data.yml @@ -0,0 +1,41 @@ +name: Update Android Data + +on: + workflow_dispatch: + schedule: + - cron: '0 2 * * *' # Runs daily at 2 AM UTC + +jobs: + download_and_gzip: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v3 + with: + ssh-key: ${{ secrets.SSH_PRIVATE_KEY }} + + - name: Download JSON data file + id: download + run: | + wget -O android-data.json "https://sql.telemetry.mozilla.org/api/queries/103542/results.json?api_key=83yUK1sJn1LFwNuiL41aZLoPV5Wwh1tmtIhzEAkG" + continue-on-error: true + + - name: Check if download succeeded + run: | + if [ ! -f android-data.json ]; then + echo "Download failed. Aborting to avoid overwriting previous data." + exit 1 + fi + + - name: Gzip + run: | + gzip -c android-data.json > android-data.json.gz + rm android-data.json + + - name: Commit and push gzipped file if changed + run: | + git config --local user.email "actions@github.com" + git config --local user.name "GitHub Actions" + git add android-data.json.gz + git diff --cached --quiet || git commit -m "Update android-data.json.gz" + git push diff --git a/android-data.json.gz b/android-data.json.gz new file mode 100644 index 0000000..a663687 Binary files /dev/null and b/android-data.json.gz differ