noaa-onms / climate-dashboard

dashboard of climate indicators across sanctuaries
https://noaa-onms.github.io/climate-dashboard/
MIT License
1 stars 0 forks source link

add automated site build #6

Closed 7yl4r closed 2 weeks ago

7yl4r commented 1 year ago

would be good to have a gh action to build the site before deploying

bbest commented 2 weeks ago

Hi @7yl4r,

Unfortunately I setup this Github Action update-dashboard.yaml to run:

And we are getting the following error:, eg in run @1b64d49:

Access Forbidden -- Your IP address is on this ERDDAP's request blacklist ``` Run Rscript scripts/get_data.R dataset: sst ~ 2024-08-26 13:24:44.906546 Error in `path_to_connection()`: ! 'Error { code=403; message="Forbidden: Access Forbidden -- Your IP address is on this ERDDAP's request blacklist. Did you often submit more than one request at a time? Did you often submit identical requests in a short period of time? Did you submit a large number of invalid requests? If you are ready to avoid these problems, please email erd.data@noaa.gov to request to be taken off of the blacklist."; } ' does not exist in current working directory ('/Users/runner/work/climate-dashboard/climate-dashboard'). Backtrace: ▆ 1. └─extractr::ed_info(ed_row$url) 2. └─rerddap::info(dataset, url = ed_url) 3. └─rerddap:::erdddap_GET(...) 4. └─rerddap:::err_handle2(tt) 5. ├─xml2::xml_text(xml_find_all(read_html(tt), "//h1")) 6. ├─xml2::xml_find_all(read_html(tt), "//h1") 7. ├─xml2::read_html(tt) 8. └─xml2:::read_html.default(tt) 9. ├─base::suppressWarnings(...) 10. │ └─base::withCallingHandlers(...) 11. ├─xml2::read_xml(x, encoding = encoding, ..., as_html = TRUE, options = options) 12. └─xml2:::read_xml.character(...) 13. └─xml2:::path_to_connection(x) 14. └─xml2:::check_path(path) 15. └─cli::cli_abort(msg, call = call) 16. └─rlang::abort(...) Execution halted ```
bbest commented 2 weeks ago

So instead, I setup a cron job on server rstudio.marinebon.app to run update_dashboard.sh every Monday with this crontab:

0 0 * * 1 /share/github/noaa-onms/climate-dashboard/scripts/update_dashboard.sh >> /var/log/cron.log 2>&1

See commit https://github.com/noaa-onms/climate-dashboard/commit/51fe33b73e7db091ee57e31b96c0ea3ef679067a