Periodic Pipeline #39
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: '*/10 * * * *' # 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 geojson | |
- name: Run Python Script | |
run: python asylex_automation.py | |
- name: Commit and Push Changes UN Treaty | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Actions" | |
git add data/UNTrendyBodyAndRegionalOnes.json | |
git commit -m "Updated UN Bodies data" | |
if [[ `git status --porcelain` ]]; then | |
git push origin main | |
echo "INFO: File updated" | |
else | |
echo "INFO: No changes detected" | |
fi | |
- name: Commit and Push Changes Countries | |
run: | | |
git add data/countries_small_updated_Aug2023.geojson | |
git commit -m "Updated countries data" | |
if [[ `git status --porcelain` ]]; then | |
git push origin main | |
echo "INFO: File updated" | |
else | |
echo "INFO: No changes detected" | |
fi | |
env: | |
REPO_ACCESS_TOKEN: ${{ secrets.REPO_ACCESS_TOKEN }} |