Skip to content

Cron Job

Cron Job #341

Workflow file for this run

name: Cron Job
on:
schedule:
- cron: "00 13 * * *"
workflow_dispatch:
jobs:
run-cron-job:
runs-on: ubuntu-latest
timeout-minutes: 30
environment: Production – mindful-journal-server
env:
DATABASE_URL: ${{ secrets.DATABASE_URL }}
TOKEN_KEY: ${{ secrets.TOKEN_KEY }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install dependencies
run: npm install
working-directory: server
- name: Run cron job
run: node autoJournalEntries.js
working-directory: server/cron
- name: Check for success and exit
run: |
if [ $? -eq 0 ]; then
echo "Job completed successfully"
exit 0 # Exit the workflow with success code
else
echo "Job failed!"
exit 1 # Exit the workflow with failure code
fi