-
Notifications
You must be signed in to change notification settings - Fork 0
105 lines (84 loc) · 2.76 KB
/
analytics.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
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 }}
copy_data:
needs: collect_analytics
runs-on: ubuntu-latest
steps:
- name: Checkout source branch
uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
- name: Configure Git
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
- name: Fetch all branches
run: git fetch --all
- name: Checkout gh-pages branch
run: git checkout gh-pages
- name: Merge latest from Source branch into gh-pages
run: |
git merge origin/Source --allow-unrelated-histories -X theirs --no-edit
- name: Copy homebridge_plugins.json to docs directory
run: cp homebridge_plugins.json docs/
- name: Commit and push changes
run: |
git add docs/homebridge_plugins.json
git commit -m "Update homebridge_plugins.json in docs directory"
git push origin gh-pages --force
update_vue_application:
needs: copy_data
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
# broke...
# - name: deploy vue application
# working-directory: ./vue-data-analyzer
# run: npm run deploy