Montly Data Update #32
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: Montly Data Update | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: 0 12 1 * * | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
# This workflow contains a single job called "build" | |
run: | |
# The type of runner that the job will run on | |
runs-on: ubuntu-latest | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v2 | |
- name: Setup Node.js environment | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '14' | |
- name: Install dependencies | |
run: npm install | |
- name: Generate data for the previous month | |
env: | |
NEXT_PUBLIC_API_URL: ${{ secrets.NEXT_PUBLIC_API_URL }} | |
MICROPUB_TOKEN: ${{ secrets.MICROPUB_TOKEN }} | |
OWNTRACKS_URL: ${{ secrets.OWNTRACKS_URL }} | |
OWNTRACKS_USERNAME: ${{ secrets.OWNTRACKS_USERNAME }} | |
OWNTRACKS_PASSWORD: ${{ secrets.OWNTRACKS_PASSWORD }} | |
OWNTRACKS_USER: ${{ secrets.OWNTRACKS_USER }} | |
OWNTRACKS_DEVICE: ${{ secrets.OWNTRACKS_DEVICE }} | |
HOME_ASSISTANT_KEY: ${{ secrets.HOME_ASSISTANT_KEY }} | |
HOME_ASSISTANT_URL: ${{ secrets.HOME_ASSISTANT_URL }} | |
run: node bin/generate-monthly-data --save | |
- name: Commit new file | |
run: | | |
git config --local user.email "action@github.com" | |
git config --local user.name "GitHub Action" | |
git add data/monthly | |
git commit -m "Add new montly data file" -a | |
- name: Push changes | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} |