Skip to content

Commit

Permalink
added a second check for ATL03 related to #14
Browse files Browse the repository at this point in the history
  • Loading branch information
mlampros committed Dec 16, 2023
1 parent 88014c2 commit 74b98fc
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/ATL03_temporary_1.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

require(rvest)

atl03_exists = rvest::read_html(x = "https://openaltimetry.earthdatacloud.nasa.gov/data/icesat2/") |>
rvest::html_nodes(xpath='//*[@id="select_products_div"]') |>
rvest::html_text() |>
strsplit(split = "\n") |>
unlist() |>
trimws(which = "both") |>
stringr::str_detect(pattern = "ATL03") |>
sum()


if (atl03_exists == 0) stop("The ATL03 product does not exist in the openaltimetry.earthdatacloud.nasa.gov/data/icesat2/ website!")
30 changes: 30 additions & 0 deletions .github/workflows/ATL03_temporary_1.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@

#.....................................................
# check every day if the "ATL03" exists in the webpage
#.....................................................

on:
schedule:
- cron: "0 6 * * *"
push:
branches: master

jobs:
container:
runs-on: ubuntu-latest
timeout-minutes: 30
container:
image: mlampros/icesat2r:rstudiodev
credentials:
username: ${{ github.repository_owner }}
password: ${{ secrets.DOCKER_PASSWORD }}
steps:
- name: Check Out Repo
uses: actions/checkout@v3

- name: Run the ATL03 httr-get
working-directory: ${{ github.workspace }}
run: |
Rscript -e "install.packages('rvest', repos = 'https://cloud.r-project.org/')"
Rscript ATL03_temporary_1.R
shell: bash

0 comments on commit 74b98fc

Please sign in to comment.