Skip to content

Instantly share code, notes, and snippets.

@JakenHerman
Last active September 1, 2021 10:13
Show Gist options
  • Save JakenHerman/06430ca05bf071f2e71f7c4d16603975 to your computer and use it in GitHub Desktop.
Save JakenHerman/06430ca05bf071f2e71f7c4d16603975 to your computer and use it in GitHub Desktop.
name: Run bot
on:
workflow_dispatch:
schedule:
# Runs every 2 hours
- cron: "0 */2 * * *"
jobs:
prep:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install pipenv
run: |
python -m pip install --upgrade pip
pip install pipenv
- name: Install dependencies
run: |
pipenv install
- name: Create ENV file
shell: bash
env:
SUPABASE_URL: ${{ secrets.SUPABASE_URL }}
SUPABASE_KEY: ${{ secrets.SUPABASE_KEY }}
REDDIT_USERNAME: ${{ secrets.REDDIT_USERNAME }}
REDDIT_PASSWORD: ${{ secrets.REDDIT_PASSWORD }}
API_SECRET: ${{ secrets.API_SECRET }}
API_CLIENT: ${{ secrets.API_CLIENT }}
run: |
touch .env
echo REDDIT_USERNAME=$REDDIT_USERNAME >> .env
echo REDDIT_PASSWORD=$REDDIT_PASSWORD >> .env
echo API_SECRET=$API_SECRET >> .env
echo API_CLIENT=$API_CLIENT >> .env
echo SUPABASE_KEY=$SUPABASE_KEY >> .env
echo SUPABASE_URL=$SUPABASE_URL >> .env
cat .env
- name: Run bot
shell: bash
run: |
pipenv run python bot.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment