Last active
April 28, 2022 21:09
-
-
Save tzafrirben/0325959209ce91ee4bbf2f1761d6fc9d to your computer and use it in GitHub Desktop.
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: Tweet water level | |
on: | |
schedule: | |
- cron: '30 14 * * *' | |
jobs: | |
tweet: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Build twitter message | |
uses: tzafrirben/[email protected] | |
id: twitter_message | |
env: | |
UPPER_RED_LINE: ${{ secrets.UPPER_RED_LINE }} | |
with: | |
bb_src: 'prepare_tweet.bb.clj' | |
bb_args: 'docs/surveys.json last_tweet.txt' | |
- name: Post tweet | |
uses: ethomson/send-tweet-action@v1 | |
if: steps.twitter_message.outputs.bb_out != '' | |
with: | |
status: "${{steps.twitter_message.outputs.bb_out}}" | |
consumer-key: ${{ secrets.TWITTER_CONSUMER_API_KEY }} | |
consumer-secret: ${{ secrets.TWITTER_CONSUMER_API_SECRET }} | |
access-token: ${{ secrets.TWITTER_ACCESS_TOKEN }} | |
access-token-secret: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }} | |
- name: Get current date | |
id: date | |
run: echo "::set-output name=date::$(date +'%Y-%m-%d')" | |
- name: Commit latest tweet date | |
uses: EndBug/add-and-commit@v4 | |
if: steps.twitter_message.outputs.bb_out != '' | |
with: | |
author_name: Tzafrir Ben Ami | |
author_email: [email protected] | |
message: "update latest tweet date ${{ steps.date.outputs.date }}" | |
add: "last_tweet.txt" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment