Skip to content

Commit 69d1a5d

Browse files
author
Spacehuhn
committed
Tweet workflow
1 parent dfafda6 commit 69d1a5d

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

.github/workflows/twitter.yml

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
on:
2+
schedule:
3+
- cron: "0 14 * * *"
4+
5+
name: Twitter Bot
6+
7+
jobs:
8+
9+
tweet:
10+
name: tweet
11+
runs-on: ubuntu-latest
12+
steps:
13+
- id: checkout
14+
uses: actions/checkout@v2
15+
- id: pip
16+
run: pip3 install tweepy
17+
- id: build-keys
18+
env:
19+
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
20+
ACCESS_TOKEN_SECRET: ${{ secrets.ACCESS_TOKEN_SECRET }}
21+
CONSUMER_KEY: ${{ secrets.CONSUMER_KEY }}
22+
CONSUMER_SECRET: ${{ secrets.CONSUMER_SECRET }}
23+
run: |
24+
echo "consumer_key = \"$CONSUMER_KEY\"" > twitter_bot/keys.py
25+
echo "consumer_secret = \"$CONSUMER_SECRET\"" >> twitter_bot/keys.py
26+
echo "access_token = \"$ACCESS_TOKEN\"" >> twitter_bot/keys.py
27+
echo "access_token_secret = \"$ACCESS_TOKEN_SECRET\"" >> twitter_bot/keys.py
28+
echo "path = \"generator/\"" >> twitter_bot/keys.py
29+
- id: tweet
30+
run: |
31+
python3 twitter_bot/tweet.py

0 commit comments

Comments
 (0)