Chart Monitor #7959
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: Chart Monitor | |
on: | |
schedule: | |
- cron: "0 * * * *" | |
workflow_dispatch: | |
jobs: | |
monitor: | |
name: Run the Chart Monitor | |
runs-on: ubuntu-latest | |
steps: | |
- name: Store runtime 🕑 | |
id: store-runtime | |
run: | | |
echo "runtime=$(/bin/date -u "+%Y-%W@%H")" >> $GITHUB_OUTPUT | |
shell: bash | |
- name: Checkout repository 🔍 | |
uses: actions/checkout@v3 | |
- name: Setup Node.js environment ⚙️ | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
- name: Install pnpm ⬇️ | |
uses: pnpm/action-setup@v2 | |
with: | |
version: 7 | |
run_install: false | |
- name: Store pnpm cache directory 💿 | |
id: pnpm-cache | |
run: | | |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT | |
- name: Cache dependencies 🗄️ | |
uses: actions/cache@v3 | |
with: | |
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }} | |
restore-keys: | | |
${{ runner.os }}-pnpm-store- | |
- name: Install dependencies 📦 | |
run: pnpm install | |
- name: Cache monitor data 📀 | |
uses: actions/cache@v3 | |
with: | |
key: ${{ runner.os }}-monitor-cache-${{ steps.store-runtime.outputs.runtime }} | |
path: | | |
@monitor/data/cache/**/*.json | |
restore-keys: | | |
${{ runner.os }}-monitor-cache- | |
- name: Run monitor 👁️ | |
run: pnpm start | |
- name: Commit changes 💾 | |
run: | | |
git config --global user.name "github-actions[bot]" | |
git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
git add -A | |
git diff-index --quiet HEAD || git commit -m "Automatic update ⚙️" && git push |