implenton - Mészáros Róbert

Scheduled GitHub Actions

For FormBus, I used two GitHub workflows. One is for code quality check by running ESList. The other is to publish a new version of the package on npm.

Both workflows are triggered when a commit is pushed to a branch. While everything happens without any extra effort, I'm the one who is initializing the events.

But GitHub Actions are not limited to these kinds of workflows. You can also schedule events. You can run workflows at specific intervals, and this opens up new possibilities for automation.

Because you can choose to run a Ubuntu image, you can do almost anything with a bit of scripting.

For example, you can rebuild your website every midnight on Netlify. Simply use curl to hit a webhook.

name: Scheduled workflow
on:
  schedule:
    - cron: '0 0 * * *'
jobs:
  build:
    name: Rebuild website
    runs-on: ubuntu-latest
    steps:
      - name: Build hook request
        run: curl -X POST -d '{}' https://api.netlify.com/build_hooks/

See all posts