Periodic Pipeline #5
This file contains 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: Periodic Pipeline | |
on: | |
schedule: | |
- cron: '*/5 * * * *' # Run every hour | |
env: | |
GCP_SERVICE_ACCOUNT_KEY: ${{ secrets.GCP_SERVICE_ACCOUNT_KEY}} | |
SHEET_ID: ${{ secrets.SHEET_ID }} | |
jobs: | |
generate-json: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.x | |
- name: Install Dependencies | |
run: | | |
pip install gspread oauth2client numpy pandas | |
- name: Run Python Script | |
run: python asylex_automation.py | |
- name: Commit and Push Changes | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Actions" | |
git add data/final_json.json | |
git commit -m "Update data" | |
if [[ `git status --porcelain` ]]; then | |
git push origin main | |
else | |
echo "WARNING: No changes detected" | |
fi | |
env: | |
REPO_ACCESS_TOKEN: ${{ secrets.REPO_ACCESS_TOKEN }} |