GetFiles #213
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
name: GetFiles | |
on: | |
push: | |
branches: ["main"] | |
# - "feat/adding-github-actions" | |
# job should run at 9.01 pst which translates to 5pm UTC | |
schedule: | |
- cron: '1 17 * * *' | |
workflow_dispatch: | |
jobs: | |
retrieve_images: | |
defaults: | |
run: | |
shell: bash | |
name: 'Download the various soil moisture related images' | |
runs-on: ubuntu-22.04 | |
environment: RUN | |
env: | |
OBJ_STORE_BUCKET: ${{ secrets.OBJ_STORE_BUCKET }} | |
OBJ_STORE_SECRET: ${{ secrets.OBJ_STORE_SECRET }} | |
OBJ_STORE_USER: ${{ secrets.OBJ_STORE_USER }} | |
OBJ_STORE_HOST: ${{ secrets.OBJ_STORE_HOST }} | |
steps: | |
- uses: actions/checkout@v3 | |
id: checkout | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11' | |
- id: install_dependencies | |
name: install python dependencies | |
shell: bash | |
run: | | |
pip install --upgrade pip | |
pip install -r python/requirements.txt | |
- id: debug | |
name: debug and list files | |
shell: bash | |
run: | | |
ls -la | |
- id: download_images | |
name: download the soil moisture images | |
shell: bash | |
run: | | |
python python/src/main.py | |
- id: generate_report | |
name: create the report file | |
shell: bash | |
run: | | |
git branch -a | |
python python/src/create_report.py | |
- name: Commit report files | |
run: | | |
git branch -a | |
git config --local user.email "github-actions[bot]@users.noreply.github.com" | |
git config --local user.name "github-actions[bot]" | |
export TZ=America/Vancouver | |
now=$(date +'%Y-%m-%d') | |
file=report/soil_moisture/report_${now}.markdown | |
git add $file | |
git commit -m "Adding new report for $now" | |
git push origin main | |