Skip to content

Daily Job Post

Daily Job Post #46

Workflow file for this run

name: Daily Job Post
on:
schedule:
# Daily at 12:00 PM NL time
- cron: '30 15 * * *'
workflow_dispatch:
inputs:
date:
type: string
description: A specific date to check jobs (YYYY-MM-DD)
required: false
jobs:
daily_post:
name: Daily Post
runs-on: ubuntu-latest
steps:
- name: Check out repo
uses: actions/checkout@v4
- name: Check out data
uses: actions/checkout@v4
with:
repository: CTS-NL/CTS-NL.github.io
path: 'CTS-NL.github.io'
- name: Setup NodeJS
uses: actions/setup-node@v4
with:
node-version: '22.x'
- name: Restore Cache
uses: actions/cache/restore@v4
id: restore-cache
with:
path: node_modules
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
- name: Install Node Modules
if: steps.restore-cache.outputs.cache-hit != 'true'
run: npm install
- name: Cache Node Modules
if: steps.restore-cache.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
path: node_modules
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
- name: Create .env file
run: |
echo "SLACK_POST_URL=${{ secrets.SLACK_POST_URL }}" >> .env
echo "DISCORD_POST_URL=${{ secrets.DISCORD_POST_URL }}" >> .env
source .env
- name: Run post-jobs script
run: node ./src/bin/cts.js jobs $GITHUB_WORKSPACE/CTS-NL.github.io/_data --date ${{ github.event.inputs.date }}