forked from php-tootbot/tootbot-template
-
-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (34 loc) · 1.26 KB
/
run.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions
on:
schedule:
# POSIX cron syntax (every 6 hours), https://crontab.guru/#0_3,9,15,21_*_*_*
- cron: "0 3,9,15,21 * * *"
name: "Run"
jobs:
run-bot:
name: "Run the bot and post to Mastodon"
runs-on: ubuntu-latest
env:
MASTODON_TOKEN: ${{ secrets.MASTODON_TOKEN }}
MASTODON_INSTANCE: ${{ secrets.MASTODON_INSTANCE }}
steps:
- name: "Checkout sources"
uses: actions/checkout@v3
- name: "Install PHP"
uses: shivammathur/setup-php@v2
with:
php-version: "8.2"
coverage: none
extensions: curl, json, mbstring, openssl, sodium
- name: "Install dependencies with composer"
uses: ramsey/composer-install@v2
- name: "Run bot"
run: php ./cli/run.php
- name: "Commit log"
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: ":octocat: posted toot"
file_pattern: "data/posted.json"
commit_user_name: "github-actions[bot]"
commit_user_email: "41898282+github-actions[bot]@users.noreply.github.com"
commit_author: "github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>"