-
Notifications
You must be signed in to change notification settings - Fork 0
93 lines (73 loc) · 3.88 KB
/
daily.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
name: "☀️ Daily tasks"
on:
schedule:
# Run daily at 11:30 pm
- cron: "30 23 * * *"
workflow_dispatch:
inputs:
year:
description: "Year"
required: false
month:
description: "Month"
required: false
jobs:
run-daily-tasks:
name: "👷 Run daily tasks"
runs-on: ubuntu-latest
env:
NOTION_TOKEN: ${{ secrets.NOTION_TOKEN }}
GOOGLE_SHEETS_API_KEY: ${{ secrets.GOOGLE_SHEETS_API_KEY }}
ULTRAHUMAN_R1_TOKEN: ${{ secrets.ULTRAHUMAN_R1_TOKEN}}
steps:
- name: "📦 Checkout"
uses: actions/checkout@v3
- name: "🍔 Set up Bun"
uses: oven-sh/setup-bun@v1
with:
bun-version: latest
- name: "✅ Install dependencies"
run: bun install
- name: "🐒 Fetch workouts value and set on Notion with given year and month"
if: "${{ github.event.inputs.year != '' && github.event.inputs.month != '' }}"
run: bun run cli set-current-value-of-workout-key-result -y ${{ github.event.inputs.year }} -m ${{ github.event.inputs.month }}
- name: "🐒 Fetch workouts value and set on Notion with current year and month"
if: "${{ github.event.inputs.year == '' && github.event.inputs.month == '' }}"
run: bun run cli set-current-value-of-workout-key-result
- name: "🧘♂️ Fetch meditations value and set on Notion with given year and month"
if: "${{ github.event.inputs.year != '' && github.event.inputs.month != '' }}"
run: bun run cli set-current-value-of-meditations-key-result -y ${{ github.event.inputs.year }} -m ${{ github.event.inputs.month }}
- name: "🧘♂️ Fetch meditations value and set on Notion with current year and month"
if: "${{ github.event.inputs.year == '' && github.event.inputs.month == '' }}"
run: bun run cli set-current-value-of-meditations-key-result
- name: "👀 Fetch observations value and set on Notion with given year and month"
if: "${{ github.event.inputs.year != '' && github.event.inputs.month != '' }}"
run: bun run cli set-current-value-of-observations-key-result -y ${{ github.event.inputs.year }} -m ${{ github.event.inputs.month }}
- name: "👀 Fetch observations value and set on Notion with current year and month"
if: "${{ github.event.inputs.year == '' && github.event.inputs.month == '' }}"
run: bun run cli set-current-value-of-observations-key-result
- name: "📃 Fetch workouts data and write to vault"
run: bun run cli save-workout-stats-to-vault
- name: "🛌 Fetch sleep data and write to vault"
run: bun run cli save-next-sleep-stats-to-vault
- name: "💤 Aggregate weekly sleep data and write to vault"
run: bun run cli save-sleep-aggregate-stats-to-vault
- name: "🕊️ Aggregate monthly meditation data and write to vault for given year and month"
if: "${{ github.event.inputs.year != '' && github.event.inputs.month != '' }}"
run: bun run cli save-monthly-meditation-aggregates-to-vault -y ${{ github.event.inputs.year }} -m ${{ github.event.inputs.month }}
- name: "🕊️ Aggregate monthly meditation data and write to vault for current year and month"
if: "${{ github.event.inputs.year == '' && github.event.inputs.month == '' }}"
run: bun run cli save-monthly-meditation-aggregates-to-vault
- name: "🗄️ Commit vault back to repo"
uses: stefanzweifel/[email protected]
with:
commit_message: "🤖 Save data to vault"
commit_user_name: "0x4444"
commit_user_email: "[email protected]"
commit_author: "0x4444 <[email protected]>"
file_pattern: "vault/*"
deploy:
name: "☁️"
needs: [run-daily-tasks]
uses: krimlabs/state-of-being/.github/workflows/cd.yml@master
secrets: inherit