-
Notifications
You must be signed in to change notification settings - Fork 2
45 lines (34 loc) · 1.01 KB
/
bot.yml
File metadata and controls
45 lines (34 loc) · 1.01 KB
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
name: RubyStackNews Bot
on:
pull_request:
workflow_dispatch:
schedule:
- cron: "1 0 * * 0"
permissions:
contents: write
jobs:
bot:
runs-on: ubuntu-latest
environment: demo
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: ruby/setup-ruby@v1
with:
ruby-version: "3.3"
- run: sudo apt-get update && sudo apt-get install -y libgd-dev
- run: gem install ruby-libgd
- run: ruby demo/rsn_events_bot/social_event_image.rb
- name: Commit image
if: github.ref == 'refs/heads/main'
run: |
git config --global user.name "rsn-bot"
git config --global user.email "ggerman@gmail.com"
git add demo/rsn_events_bot/rsn_events.png
git commit -m "Update Events image" || echo "no changes"
git push
- run: ruby demo/rsn_events_bot/publish.rb
env:
MASTODON_TOKEN: ${{ secrets.MASTODON_TOKEN }}
MASTODON_INSTANCE: https://ruby.social