RubyStackNews Bot #29
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: RubyStackNews Bot | |
| on: | |
| pull_request: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: "0 9 * * *" | |
| 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 x | |
| - 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 "bot@rubystacknews.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/post_to_mastodon.rb | |
| env: | |
| MASTODON_TOKEN: ${{ secrets.MASTODON_TOKEN }} | |
| MASTODON_INSTANCE: https://ruby.social |