Skip to content

Commit b30e538

Browse files
committed
Add workflow for android data
1 parent 3943aa6 commit b30e538

File tree

4 files changed

+41
-0
lines changed

4 files changed

+41
-0
lines changed
12 KB
Binary file not shown.
12 KB
Binary file not shown.
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Update Android Data
2+
3+
on:
4+
workflow_dispatch:
5+
schedule:
6+
- cron: '0 2 * * *' # Runs daily at 2 AM UTC
7+
8+
jobs:
9+
download_and_gzip:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout repository
13+
uses: actions/checkout@v3
14+
with:
15+
ssh-key: ${{ secrets.SSH_PRIVATE_KEY }}
16+
17+
- name: Download JSON data file
18+
id: download
19+
run: |
20+
wget -O android-data.json "https://sql.telemetry.mozilla.org/api/queries/103542/results.json?api_key=83yUK1sJn1LFwNuiL41aZLoPV5Wwh1tmtIhzEAkG"
21+
continue-on-error: true
22+
23+
- name: Check if download succeeded
24+
run: |
25+
if [ ! -f android-data.json ]; then
26+
echo "Download failed. Aborting to avoid overwriting previous data."
27+
exit 1
28+
fi
29+
30+
- name: Gzip
31+
run: |
32+
gzip -c android-data.json > android-data.json.gz
33+
rm android-data.json
34+
35+
- name: Commit and push gzipped file if changed
36+
run: |
37+
git config --local user.email "[email protected]"
38+
git config --local user.name "GitHub Actions"
39+
git add android-data.json.gz
40+
git diff --cached --quiet || git commit -m "Update android-data.json.gz"
41+
git push

android-data.json.gz

445 KB
Binary file not shown.

0 commit comments

Comments
 (0)