Runner #62815
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
# 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 |