Update Analytics #624
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: Update Analytics | |
on: | |
schedule: | |
- cron: '0 8 * * *' | |
jobs: | |
update: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checks out the repo | |
uses: actions/checkout@v3 | |
- name: Sets up node | |
uses: actions/setup-node@v1 | |
with: | |
node-version: 16 | |
- name: Fetches dependencies | |
run: | | |
npm install --location=global yarn && | |
yarn install --frozen-lockfile | |
- name: Updates analytics | |
run: yarn get-analytics | |
env: | |
GOOGLE_KEY: ${{ secrets.GOOGLE_KEY }} | |
- name: Commit update | |
run: | | |
[ $(git status --porcelain | wc -l) -eq "0" ] && exit 0; | |
git config --global user.name 'Mykola Myslovskyi' | |
git config --global user.email '${{ secrets.EMAIL }}' | |
git commit -am "chore: update analytics" && git push |