PAGASA 10-Day Weather Forecast
Introduction
ACAP sources its 10-day weather forecast data from PAGASA's public 10-day weather forecast data (available as Excel files from day 1 - day 10) in their 10-Day Climate Forecast web page at https://www.pagasa.dost.gov.ph/climate/climate-prediction/10-day-climate-forecast (opens in a new tab).
This section describes updating the initial 10-day weather forecast data with the latest values.
ACAP's initialization steps from the Installation and Setup section use an older set of 10-day weather forecast data for demonstration.
After confirming successful initialization and deployment setup, ACAP's cron script, running in a GitHub Actions Scheduled Workflow, will regularly sync with the latest posted PAGASA 10-data weather forecast daily once between 9:30 AM - 12:00 PM.
Update Steps
Use a target environment
Open the server .env
file. Update the FIREBASE_SERVICE_ACC
and FIREBASE_PRIVATE_KEY
keys with the development or production key values.
Run the NPM Script
-
Navigate to the
/server
directory from a terminal. -
Run the command:
npm run cron:tenday
Re-run on GitHub Actions
This method is an alternate option for running the NPM script aside from step #2, available after confirming a successful setup and deployment of the GitHub Actions cron jobs.
- Go to the forked repository's Actions tab.
- Select the CRON Download, Parse and Upload Excel Files workflow in the left-side menu.
- Select and click one of the latest successful workflow runs.
- Press the button on the upper right with the label "Re-run all jobs."
Manual Data Upload
- Sign in as an Admin to the ACAP website.
- Go to the ACAP Settings → 10-DAY tab.
- Follow the instructions for manually updating the 10-day weather forecast data. It involves:
- Download the day 1 - day 10 PAGASA 10-day weather forecast Excel files from PASAGA's 10-Day Climate Forecast (opens in a new tab) web page to the local PC or laptop.
- Upload all ten (10) of the Excel files using the ACAP Settings → 10-DAY upload form.
- Press the SUBMIT button after selecting the Excel files from step #3.
- Wait for the update success or fail status response to appear. A successful trigger will display an updated "Date synced" field in the Current Data Update Summary section, displaying the latest time and date of the successful update.
ACAP REST API
10-day weather forecast data is available in the REST API endpoints (plus other query parameters) if the ACAP-RCMAS REST APIs are active:
- Current data:
GET /api/weatherforecast?type=tenday
- Historical data:
GET /api/weatherforecast/archives?type=tenday
Recommendations
Since the 10-day weather forecast updater runs in an NPM script, options are available for running it in OS-native cron or task schedulers as an alternative to using GitHub Actions Scheduled Workflow.