Add daily workflow for harvesting observation weather data #13
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
schedule: | |
- cron: "0 0 * * *" # Run at 9 AM in JST | |
push: | |
branches: | |
- main | |
jobs: | |
daily: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Cache | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db | |
packages/cron_jobs/target/ | |
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
restore-keys: | | |
${{ runner.os }}-cargo- | |
- name: Build | |
run: pnpm --filter cron_jobs exec cargo build --release | |
- name: Set AWS credentials to .env file | |
run: | | |
echo ${{ secrets.AWS_ACCESS_KEY_ID }} >> packages/cron_jobs/.env | |
echo ${{ secrets.AWS_SECRET_ACCESS_KEY }} >> packages/cron_jobs/.env | |
- name: Harvest the observation weather data | |
run: | | |
./packages/cron_jobs/target/release/harvest_observation_weather_data |