โ๏ธ Daily tasks #431
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: "โ๏ธ 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 |