Skip to content

Runner

Runner #62822

Workflow file for this run

# Runs the code from docker image and push updates to repo and channel
name: Runner
on:
push:
schedule:
- cron: "10,30,50 5-20 * * *"
jobs:
scheduled:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v2
-
name: Run
run: |-
docker run \
--mount type=bind,src=`pwd`/data,dst=/data \
-e TOKEN=${{ secrets.TOKEN }} \
-e CHANNEL=${{ secrets.CHANNEL }} \
-e ADMIN_CHAT_ID=${{ secrets.ADMIN_CHAT_ID }} \
-e INFO_SCRIPT='getWaterInfo.js' \
-e DATA_DIR='/data' \
vikmind/tgn-water:latest npm start
-
name: Commit and push if changed
working-directory: ~
run: |-
git config user.name "Automated"
git config user.email "[email protected]"
git add -A
timestamp=$(date --rfc-3339=seconds --utc)
git commit -m "Latest data: ${timestamp}" || exit 0
git push