Update Homebridge Analytics #5
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 Homebridge Analytics | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '30 1 * * *' | |
jobs: | |
collect_analytics: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: lts/* | |
- name: Install dependencies | |
working-directory: ./scripts | |
run: npm install | |
- name: Gather report data | |
working-directory: ./scripts | |
run: npm run extract | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Run reports | |
working-directory: ./scripts | |
run: npm run reports | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Set current date as env variable | |
run: echo "NOW=$(date +'%Y-%m-%d')" >> $GITHUB_ENV | |
- name: Commit files | |
run: | | |
git config --local user.email "github-actions[bot]@users.noreply.github.com" | |
git config --local user.name "github-actions[bot]" | |
git add * || true | |
git commit -a -m "Data Updated ${{ env.NOW }}" || true | |
- name: Push changes | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: ${{ github.ref }} | |
update_vue_application: | |
needs: collect_analytics | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: lts/* | |
- name: Install dependencies | |
working-directory: ./vue-data-analyzer | |
run: npm install | |
- name: deploy vue application | |
working-directory: ./vue-data-analyzer | |
run: npm run deploy |