Skip to content

Make US Tickers File #2021

Make US Tickers File

Make US Tickers File #2021

name: Make US Tickers File
on:
push:
branches:
- 'main'
paths-ignore:
- '_utils.py'
schedule:
# * is a special character in YAML so you have to quote this string
- cron: '5 4-20/7 * * *'
workflow_dispatch:
# reddit access for golang tests
# since I am an single dev
# what I care about is regression
# making sure my code still works on the reddit api
env:
remote: "friendlyuser/stonk_names"
branch: "main"
jobs:
build:
runs-on: ubuntu-latest
name: Scan For Docs
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v4
with:
python-version: '3.10' # Version range or exact version of a Python version to use, using SemVer's version range syntax
architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified
- name: Run Script to get us tickers
run: |
pip install -r requirements.txt
python get_us_ticker_data.py
- uses: actions/upload-artifact@v2
with:
name: usd_tickers
path: data/us_stock_data.csv
- uses: actions/upload-artifact@v2
with:
name: usd_tickers_stock_data_missed
path: data/us_stock_data_missed.txt
- name: Commit files
run: |
git add data/*.csv
git add .
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git commit -m "Add changes" -a
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}
- uses: sarisia/actions-status-discord@v1
if: failure()
with:
webhook: ${{ secrets.DISCORD_CODE_STATUS_WEBHOOK }}
status: ${{ job.status }}
title: ${{github.repository}}
description: "Failed to get eod tickers"
nofail: false
nocontext: false
noprefix: false
color: 0xff0000
username: Eod Tickers
- name: Dolt Import
uses: dolthub/[email protected]
id: "dolt-import"
continue-on-error: true
with:
before: |
file_list=`ls $GITHUB_WORKSPACE/data/us_stock_data.csv`
head "${file_list[1]}"
for file in "${file_list[@]}"; do
dolt table import --update-table -pk symbol us_tickers "$file"
done
remote: ${{ env.remote }}
branch: ${{ env.branch }}
commit_message: "Dolt action commit"
dolthub_credential: ${{ secrets.DOLTHUB_SECRET }}
push: true