Skip to content

Commit

Permalink
Add workflow for android data
Browse files Browse the repository at this point in the history
  • Loading branch information
dpalmeiro committed Nov 11, 2024
1 parent 3943aa6 commit b30e538
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 0 deletions.
Binary file added .github/workflows/.update_android_data.yml.swp
Binary file not shown.
Binary file added .github/workflows/.update_js_metrics.yml.swp
Binary file not shown.
41 changes: 41 additions & 0 deletions .github/workflows/update_android_data.yml
Original file line number Diff line number Diff line change
@@ -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
Binary file added android-data.json.gz
Binary file not shown.

0 comments on commit b30e538

Please sign in to comment.