.github/workflows/daily.yaml #12
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 | |
- uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/registry | |
~/.cargo/git | |
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
restore-keys: | | |
${{ runner.os }}-cargo- | |
- uses: docker/setup-buildx-action@v3 | |
- uses: docker/build-push-action@v6 | |
id: build | |
with: | |
context: . | |
push: false | |
tags: cron_jobs:latest | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
load: true | |
- 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: | | |
docker run --rm cron_jobs cargo run --bin harvest_observation_weather_data |