Skip to content

Tweet a Joke

Tweet a Joke #29020

Workflow file for this run

# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: Tweet a Joke
on:
workflow_dispatch:
schedule:
- cron: '0 0/1 * * *'
jobs:
tweet:
runs-on: ubuntu-latest
env:
consumer_key: ${{ secrets.consumer_key }}
consumer_secret: ${{ secrets.consumer_secret }}
access_token: ${{ secrets.access_token }}
access_token_secret: ${{ secrets.access_token_secret }}
steps:
- uses: actions/checkout@v2
- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Use Node.js 12.x
uses: actions/setup-node@v1
with:
node-version: 12.x
- run: npm install
- name: Run the Tweet Joke script
run: node ./tweet/tweetjoke.js