From 05305a4a7d34f1d4748253e13802aeebc0d30fa1 Mon Sep 17 00:00:00 2001 From: daemon1024 Date: Fri, 6 Aug 2021 01:02:43 +0530 Subject: [PATCH 1/4] add json to store tagLocations data --- tagLocStore.json | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 tagLocStore.json diff --git a/tagLocStore.json b/tagLocStore.json new file mode 100644 index 0000000000..e69de29bb2 From fb5649e26daa9600b284d32c22587579d98d51d0 Mon Sep 17 00:00:00 2001 From: daemon1024 Date: Fri, 6 Aug 2021 01:14:16 +0530 Subject: [PATCH 2/4] workflow cronjob to update tagLoc store every hour --- .github/workflows/store-tagLoc.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 .github/workflows/store-tagLoc.yml diff --git a/.github/workflows/store-tagLoc.yml b/.github/workflows/store-tagLoc.yml new file mode 100644 index 0000000000..e1d8ed1bf3 --- /dev/null +++ b/.github/workflows/store-tagLoc.yml @@ -0,0 +1,23 @@ +name: Tag Locations Data + +on: + schedule: + - cron: "*/60 * * * *" + + workflow_dispatch: + +jobs: + fetch: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Fetch data from API endpoint + run: curl "https://publiclab.org/api/srch/taglocations?nwlat=52&selat=-52&nwlng=-150&selng=150&limit=1000" > data/tagLocStore.json + + - name: Commit and push + working-directory: ./website + run: | + git add . + git commit -m "updated tagLocations data" + git push https://${{ secrets.GITHUB_TOKEN }}@github.com/daemon1024/plots2 From 2912c22111a726955697be07107170943779b24e Mon Sep 17 00:00:00 2001 From: daemon1024 Date: Fri, 6 Aug 2021 01:26:10 +0530 Subject: [PATCH 3/4] move json to static folder --- .github/workflows/store-tagLoc.yml | 2 +- tagLocStore.json => static/tagLocStore.json | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename tagLocStore.json => static/tagLocStore.json (100%) diff --git a/.github/workflows/store-tagLoc.yml b/.github/workflows/store-tagLoc.yml index e1d8ed1bf3..805a4b6cd9 100644 --- a/.github/workflows/store-tagLoc.yml +++ b/.github/workflows/store-tagLoc.yml @@ -13,7 +13,7 @@ jobs: - uses: actions/checkout@v2 - name: Fetch data from API endpoint - run: curl "https://publiclab.org/api/srch/taglocations?nwlat=52&selat=-52&nwlng=-150&selng=150&limit=1000" > data/tagLocStore.json + run: curl "https://publiclab.org/api/srch/taglocations?nwlat=52&selat=-52&nwlng=-150&selng=150&limit=1000" > static/tagLocStore.json - name: Commit and push working-directory: ./website diff --git a/tagLocStore.json b/static/tagLocStore.json similarity index 100% rename from tagLocStore.json rename to static/tagLocStore.json From f055afddfdbd6d3c9189a2f8e4327b3ebd3c8773 Mon Sep 17 00:00:00 2001 From: daemon1024 Date: Fri, 6 Aug 2021 02:07:29 +0530 Subject: [PATCH 4/4] update tagloc store workflow --- .github/workflows/store-tagLoc.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/store-tagLoc.yml b/.github/workflows/store-tagLoc.yml index 805a4b6cd9..2c6367deb4 100644 --- a/.github/workflows/store-tagLoc.yml +++ b/.github/workflows/store-tagLoc.yml @@ -7,7 +7,7 @@ on: workflow_dispatch: jobs: - fetch: + store: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 @@ -15,9 +15,15 @@ jobs: - name: Fetch data from API endpoint run: curl "https://publiclab.org/api/srch/taglocations?nwlat=52&selat=-52&nwlng=-150&selng=150&limit=1000" > static/tagLocStore.json + - name: Check if changes exist + run: | + git status + git diff + - name: Commit and push - working-directory: ./website run: | + git config --global user.email "github-actions[bot]@users.noreply.github.com" + git config --global user.name "github-actions[bot]" git add . git commit -m "updated tagLocations data" git push https://${{ secrets.GITHUB_TOKEN }}@github.com/daemon1024/plots2