Auto Update & Deploy #1489
This file contains hidden or 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: Auto Update & Deploy | |
on: | |
schedule: | |
- cron: '0 1 * * *' # Runs daily at 1 AM UTC | |
push: | |
branches: | |
- main | |
permissions: | |
contents: write # Allows GITHUB_TOKEN to push changes | |
jobs: | |
update: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.8' | |
architecture: x64 | |
- name: Install dependencies | |
run: pip install -r scripts/requirements.txt | |
- name: Process Data | |
run: python scripts/process.py | |
- name: Commit changes | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Action" | |
git add -A | |
git commit --allow-empty -m "Auto-update of the data packages" | |
- name: Pull latest changes | |
run: git pull --rebase origin main | |
- name: Push changes | |
uses: ad-m/[email protected] | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: main |