twoot on a schedule #9168
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: twoot on a schedule | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: "12 2,5,8,11,14,17,20,23 * * *" | |
jobs: | |
scheduled: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/checkout@v4 | |
with: | |
# disjoint branch with "unused concept" data | |
ref: "data" | |
path: "data_repo" | |
- uses: pnpm/action-setup@18ac635edf3d6cd3e88d281bceecc25c4dbc1e73 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version-file: ".node-version" | |
cache: "pnpm" | |
- run: pnpm install --frozen-lockfile | |
- run: pnpm build | |
- run: pnpm start | |
env: | |
DATA_DIR: "data_repo" | |
NODE_ENV: "production" | |
MASTODON_TOKEN: ${{ secrets.MASTODON_TOKEN }} | |
SENTRY_DSN: ${{ secrets.SENTRY_DSN }} | |
- name: Commit and push if changed | |
run: |- | |
cd data_repo | |
git config user.name "Automated" | |
git config user.email "[email protected]" | |
git add -A | |
timestamp=$(date -u) | |
git commit -m "Latest data: ${timestamp}" || exit 0 | |
git push |